Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/.gitea/workflows/a11y.yml
T
2026-07-08 16:15:37 +02:00

91 lines
3.2 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 every PR + push to main.
#
# Mirror of .github/workflows/a11y.yml for the Gitea runner.
#
# Docs: docs/contributing/wcag-audit.md
on:
push:
branches:
- main
pull_request:
# Cancel superseded runs so rapid pushes don't pile up unclaimed on the runner
# (mirrors ci.yml). Without this each push stacked a new a11y run on the 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@v4
- name: Enable Corepack
run: corepack enable
- name: Prepare pnpm 10.33.0
run: corepack prepare pnpm@10.33.0 --activate
- name: Configure pnpm store
run: pnpm config set store-dir .pnpm-store
- name: Cache pnpm store
uses: actions/cache@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