forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Axe accessibility test support (alshedivat#2080)
Added GitHub action to do axe accessibility tests with [axe cli](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli). I believe it is best by default to let this be run only manually, since fixing some of the issues are not straightforward (I haven't fixed them all for this template yet). --------- Signed-off-by: George Araújo <[email protected]>
- Loading branch information
1 parent
30f3c14
commit 1775a9a
Showing
5 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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@v3 | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.2.2" | ||
bundler-cache: true | ||
- name: Update _config.yml ⚙️ | ||
uses: fjogeleit/[email protected] | ||
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 | ||
npm install -g purgecss | ||
export JEKYLL_ENV=production | ||
bundle exec jekyll build --lsi | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters