Check WCAG Standards #455
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
--- | |
# Pa11y-CI automated accessibility audit | |
# | |
# - automatically runs when new code is merged into main and deployed | |
# - a manually trigger run tests release candidate in pre-production by default | |
# ------------------------------------------------------------------------------ | |
name: Check WCAG Standards | |
on: | |
workflow_run: | |
workflows: | |
- Deploy Development App | |
branches: | |
- main | |
types: | |
- completed | |
workflow_dispatch: | |
inputs: | |
workspace: | |
description: Deployment workspace to test against (staging, dev, review-pr-xxx) | |
type: string | |
default: staging | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
environment: development | |
env: | |
BOT_TOKEN: ${{ secrets.WEBAPP_CONFIG_BOT_TOKEN }} | |
DOMAIN: eyrecovery-${{ inputs.workspace || 'dev' }}.azurewebsites.net | |
steps: | |
- | |
name: Checkout Code | |
uses: actions/checkout@v4 | |
- | |
name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
- | |
name: Install Chrome | |
uses: browser-actions/setup-chrome@latest | |
- | |
name: Install pa11y-ci | |
env: | |
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true' | |
run: | | |
npm install --global --unsafe-perm puppeteer pa11y-ci | |
mkdir /tmp/pa11y | |
sed -i "s/token/${BOT_TOKEN}/g" .pa11yci | |
- | |
name: Audit | |
env: | |
PUPPETEER_EXECUTABLE_PATH: /opt/hostedtoolcache/chromium/latest/x64/chrome | |
run: pa11y-ci --sitemap https://${DOMAIN}/sitemap.xml > report.txt | |
- | |
name: Report | |
run: cat report.txt && ((`cat report.txt | grep sign-in | wc -l`<2)) || exit 1 |