Skip to content

Commit

Permalink
Add pa11y-ci for automated accessibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Oct 21, 2021
1 parent 2e393bb commit 95fa79a
Show file tree
Hide file tree
Showing 5 changed files with 2,319 additions and 197 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/pa11y.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Tests

on:
push:
branches-ignore:
- "dependabot/**"
pull_request:

env:
FORCE_COLOR: 2
NODE: 16

jobs:
docs:
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "${{ env.NODE }}"
cache: npm

- run: java -version

- name: Install npm dependencies
run: npm ci

- name: Compile dist
run: npm run dist

- name: Update sri
run: npm run release-sri

- name: Test docs
run: npm run docs-build

- name: Run accessibility tests
run: npm run docs-accessibility-json

- name: Generate HTML accessibility results
run: npm run docs-pa11y-html
if: failure()

- name: Upload accessibility results
uses: actions/upload-artifact@v2
if: failure()
with:
name: pa11y-ci-results
path: pa11y-ci-report/
if-no-files-found: error
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ Thumbs.db
# Folders to ignore
/js/coverage/
/node_modules/

# Pa11y
/pa11y-ci-report/
pa11y-ci-results.json
11 changes: 11 additions & 0 deletions build/.pa11yci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"standard": "WCAG2AA",
"level": "error",
"concurrency": 4,
"defaults": {
"runners": [
"htmlcs"
],
"hideElements": ""
}
}
Loading

0 comments on commit 95fa79a

Please sign in to comment.