Files
webmail/.github/workflows/perf-guard.yml
T
Linus Rath 47bfd754f7 ci: check the main screens for accessibility regressions on every push
A Playwright job on the perf guard's production build runs axe-core's
WCAG 2.2 A/AA rules on the mail list, reading pane, composer, calendar,
contacts and Settings > Accessibility, and fails when a screen has more
serious or critical violations than scripts/a11y-guard/budget.json
allows (all zero today). Two more checks cover what axe can't see: the
keyboard focus outline stays visible in Windows contrast themes, and
single-key shortcuts don't act on the mail behind an open dialog.

axe-core is vendored next to the spec (MPL-2.0, see NOTICE), so the
check adds no dependency. `A11Y_GUARD_UPDATE=1 npm run test:a11y-guard`
rewrites the budget.
2026-10-29 20:02:10 +01:00

59 lines
1.7 KiB
YAML

name: "CI: Perf guard"
# Render passes, component renders and JMAP requests per open / search /
# folder switch, against a production build with the dev mock's
# benchmark-sized corpus (scripts/perf-guard). Counts, not timings: they do
# not drift with runner load, so a failure means the code does more work.
on:
push:
pull_request:
# The job builds and runs the checked-out code; a compromised step must not
# hold a token that can write to the repository.
permissions:
contents: read
jobs:
perf-guard:
name: Perf guard
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
# The same bundler the Docker image uses, with the dev mock compiled in.
- name: Build
env:
DEV_MOCK_JMAP: "true"
NEXT_TELEMETRY_DISABLED: "1"
GIT_COMMIT: ${{ github.sha }}
run: node scripts/build-plugin-sandbox.mjs && npx next build --webpack
- name: Run perf guard
env:
CI: "true"
run: npm run test:perf-guard
# Same build: axe's WCAG 2.2 A/AA checks per main screen against
# scripts/a11y-guard/budget.json, plus keyboard checks axe can't make.
# Runs even when the perf guard failed, so both results show.
- name: Run accessibility guard
if: success() || failure()
env:
CI: "true"
run: npm run test:a11y-guard