simplify and broaden scrollable region fix #19
Workflow file for this run
This file contains hidden or 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
| name: Accessibility Checks | |
| on: | |
| push: | |
| workflow_dispatch: | |
| env: | |
| PRODUCTION_URL: "https://ds100.org/debugging-guide/" | |
| SITE_SUBDIR: "debugging-guide" | |
| jobs: | |
| axe-audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Setup Node.js and install Axe and http-server | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Axe and Server | |
| run: npm install -g @axe-core/cli http-server | |
| # Start Local Server | |
| - name: Start Local Server | |
| run: | | |
| # Mimic the production path structure exactly with | |
| # the local server | |
| mkdir -p public/${{ env.SITE_SUBDIR }} | |
| cp -r docs/* public/${{ env.SITE_SUBDIR }}/ | |
| # Serve the 'public' folder on port 3000 | |
| npx http-server ./public -p 3000 > /dev/null 2>&1 & | |
| sleep 5 | |
| # Run Axe Scan | |
| - name: Run Accessibility Scan | |
| id: axe-scan | |
| run: | | |
| # Swap the Production URL for Localhost + Subdirectory | |
| LOCAL_URL="http://localhost:3000/${{ env.SITE_SUBDIR }}/" | |
| URLS=$(cat docs/sitemap.xml | \ | |
| sed -n 's/.*<loc>\(.*\)<\/loc>.*/\1/p' | \ | |
| sed "s|${{ env.PRODUCTION_URL }}|$LOCAL_URL|" | \ | |
| tr '\n' ' ') | |
| echo "Scanning the following pages:" | |
| echo "$URLS" | |
| # Run Axe | |
| axe $URLS \ | |
| --tags wcag2a,wcag2aa,wcag21a,wcag21aa \ | |
| --save axe-report.json \ | |
| --exit | |
| # Upload Report even if previous step fails | |
| - name: Upload Accessibility Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: axe-report | |
| path: axe-report.json |