Skip to content

GitHub Action: runs Axe accessibility tests on changed files #2

GitHub Action: runs Axe accessibility tests on changed files

GitHub Action: runs Axe accessibility tests on changed files #2

Workflow file for this run

name: pa11y-ci
on:
workflow_dispatch:
push:
branches:
- gh-pages
pull_request:
permissions:
contents: read
pull-requests: read
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
calculate-pages-changed:
name: Calculate URLs of pages changed from gh-pages branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Calculate URLs and output to JavaScript module
run: sh ./generate_pa11y_ci_urls_from_git_diff.sh gh-pages
- name: Log contents of resulting JavaScript module
run: cat ./pa11y-ci-urls.js
run-blog:
name: Run the blog locally
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.3
- name: Install gems
run: bundle config path vendor/bundle && bundle install
- name: Run the blog
run: bundle exec jekyll serve &
run-pa11y-ci:
name: Run pa11y-ci against the local version of the blog
runs-on: ubuntu-latest
needs:
- calculate-pages-changed
- run-blog
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.10.x
cache: npm
- name: Install NPM dependencies
run: npm ci
- name: Run pa11y-ci
run: npm run pa11y-ci