Skip to content

v1.10.0

v1.10.0 #24

Workflow file for this run

# Accessibility audit — WCAG 2.1 AA
#
# Runs pa11y-ci against the built VitePress docs to ensure the homepage and
# key pages remain WCAG 2.1 AA compliant.
#
# Triggers:
# - push to main touching docs/** or this workflow / config
# - every pull_request touching the same paths
# - workflow_dispatch (manual run)
#
# Strategy:
# 1. Build the docs with `bun run docs:build:a11y` (sets VITEPRESS_HOSTNAME=
# http://localhost:4173 so the generated sitemap.xml contains localhost
# URLs that pa11y-ci can reach directly)
# 2. Start `vitepress preview` via the shared composite action
# 3. Run pa11y-ci configured in .pa11yci.json (WCAG 2.1 AA, errors only)
#
# Chrome: Ubuntu-latest ships google-chrome-stable. We skip Puppeteer's own
# Chromium download (PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1) and point directly to
# the system Chrome via PUPPETEER_EXECUTABLE_PATH at runtime (~200 MB saved).
name: Accessibility audit (WCAG 2.1 AA)
on:
pull_request:
paths:
- "docs/**"
- ".github/workflows/a11y.yaml"
- ".pa11yci.json"
workflow_dispatch:
# One audit at a time per branch; cancel stale runs on new push.
concurrency:
group: a11y-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
audit:
name: WCAG 2.1 AA pages audit
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Bun
uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2.1.3
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build docs (a11y — sitemap will use localhost URLs)
run: bun run docs:build:a11y
# Shared composite action: starts preview server + waits until ready.
- name: Start VitePress preview server
uses: ./.github/actions/start-preview-server
# Run the audit. The env vars tell Puppeteer (used by pa11y) to use the
# pre-installed system Chrome instead of downloading a Chromium binary.
- name: Run accessibility audit (pa11y-ci)
env:
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome-stable
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "1"
run: bun run docs:a11y
# Upload the pa11y-ci JSON report as an artifact so failures are
# easy to inspect without re-running the workflow.
- name: Upload audit report
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: pa11y-ci-report
path: a11y-report.json
if-no-files-found: ignore