97 lines
3.6 KiB
YAML
97 lines
3.6 KiB
YAML
name: Accessibility
|
|
|
|
# Runs the axe-core vitest suites (apps/web ui components, SkipToContent)
|
|
# and the WCAG-2.2-AA color-contrast verifier on manual demand.
|
|
#
|
|
# Docs: docs/contributing/wcag-audit.md
|
|
|
|
# TEMPORARY RUNNER RELIEF (2026-07-19): automatic PR/main triggers are paused
|
|
# through 2026-07-22. Re-enable them with UI-focused path filters afterwards.
|
|
# The fast accessibility contracts in ci.yml remain active meanwhile.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
# Keep duplicate manual runs from occupying the shared runner queue.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
axe:
|
|
name: axe-core + color-contrast
|
|
# Use the self-hosted Gitea runner label (like every ci.yml job). The previous
|
|
# `ubuntu-latest` was a leftover from the GitHub mirror and matches no Gitea
|
|
# runner, so this job sat pending forever (never claimed) on every PR + push.
|
|
runs-on: toolctrl-ci
|
|
timeout-minutes: 20
|
|
env:
|
|
DATABASE_URL: postgresql://hivegrid:hivegrid@localhost:5432/hivegrid?schema=public
|
|
# Same repo variable ci.yml exposes top-level: the internal Gitea host IP that the
|
|
# "Resolve internal Gitea host" step writes to /etc/hosts so checkout can clone
|
|
# git.tool-ctrl.de inside the runner container. Without it the step is a no-op.
|
|
HIVEGRID_GITEA_HOST_IP: ${{ vars.HIVEGRID_GITEA_HOST_IP }}
|
|
|
|
steps:
|
|
# Same as every ci.yml job: make the internal Gitea host resolvable inside the
|
|
# runner container so actions/checkout can clone git.tool-ctrl.de. Without this the
|
|
# checkout step fails (the job never had it -> a11y could never run on Gitea).
|
|
- name: Resolve internal Gitea host
|
|
run: |
|
|
if [ -n "${HIVEGRID_GITEA_HOST_IP:-}" ]; then
|
|
if ! HIVEGRID_GITEA_HOST_IP="$HIVEGRID_GITEA_HOST_IP" node -e 'process.exit(require("node:net").isIP(process.env.HIVEGRID_GITEA_HOST_IP || "") ? 0 : 1)'; then
|
|
echo "HIVEGRID_GITEA_HOST_IP must be a single IPv4 or IPv6 token"
|
|
exit 1
|
|
fi
|
|
printf '%s git.tool-ctrl.de\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
|
fi
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version-file: .nvmrc
|
|
|
|
- name: Persist Node.js toolchain
|
|
run: bash scripts/ci/persist-node-toolchain.sh
|
|
|
|
- name: Enable Corepack
|
|
run: corepack enable --install-directory /usr/local/bin
|
|
|
|
- name: Prepare pnpm 11.12.0
|
|
run: corepack prepare pnpm@11.12.0 --activate
|
|
|
|
- name: Configure pnpm store
|
|
run: pnpm config set store-dir .pnpm-store
|
|
|
|
- name: Cache pnpm store
|
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
|
with:
|
|
path: .pnpm-store
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile --prefer-offline
|
|
|
|
- name: Run color-contrast verifier
|
|
run: pnpm run verify:color-contrast
|
|
|
|
- name: Verify accessibility coverage
|
|
run: pnpm run verify:a11y-coverage
|
|
|
|
- name: Run axe vitest suite (test:a11y)
|
|
run: pnpm run test:a11y
|
|
|
|
- name: Verify accessibility lint baseline
|
|
run: pnpm run verify:a11y-baseline
|
|
|
|
- name: Lint accessibility rules (eslint-plugin-jsx-a11y)
|
|
run: pnpm run lint
|