64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
name: Axe accessibility testing
|
|
|
|
on:
|
|
# if you want to run this on every push uncomment the following lines
|
|
# push:
|
|
# branches:
|
|
# - master
|
|
# - main
|
|
# pull_request:
|
|
# branches:
|
|
# - master
|
|
# - main
|
|
workflow_dispatch:
|
|
inputs:
|
|
url:
|
|
description: "URL to be checked (e.g.: blog/)"
|
|
required: false
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
URL: ""
|
|
|
|
jobs:
|
|
check:
|
|
# available images: https://github.com/actions/runner-images#available-images
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout 🛎️
|
|
uses: actions/checkout@v4
|
|
- name: Setup Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: "3.3"
|
|
bundler-cache: true
|
|
- name: Update _config.yml ⚙️
|
|
uses: fjogeleit/yaml-update-action@main
|
|
with:
|
|
commitChange: false
|
|
valueFile: "_config.yml"
|
|
changes: |
|
|
{
|
|
"giscus.repo": "${{ github.repository }}",
|
|
"baseurl": ""
|
|
}
|
|
- name: Install and Build 🔧
|
|
run: |
|
|
pip3 install --upgrade jupyter
|
|
npm install -g mermaid.cli
|
|
export JEKYLL_ENV=production
|
|
bundle exec jekyll build --lsi
|
|
- name: Purge unused CSS 🧹
|
|
run: |
|
|
npm install -g purgecss
|
|
purgecss -c purgecss.config.js
|
|
- name: Run axe 🪓
|
|
# https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli
|
|
run: |
|
|
npm install -g @axe-core/cli
|
|
npm install -g http-server
|
|
http-server _site/ &
|
|
axe http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit
|