Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/a11y.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Accessibility

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
a11y:
name: Playwright a11y scan
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout your repository using git
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install dependencies
run: npm ci
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
- name: Run accessibility tests
env:
SKIP_BUILD_COMPRESS: 1
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run test:a11y
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
playwright-report/
test-results/
retention-days: 14
24 changes: 17 additions & 7 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@ import { defineConfig, devices } from "@playwright/test";

const PORT = 4321;
const BASE_URL = `http://localhost:${PORT}`;
const isCI = Boolean(process.env.CI);

export default defineConfig({
testDir: "./test/a11y",
testMatch: "**/*.spec.ts",
outputDir: "./test-results",
fullyParallel: true,
reporter: [
["list"],
['html', { outputFolder: 'playwright-report', open: 'never' }]
],
forbidOnly: isCI,
retries: isCI ? 1 : 0,
reporter: isCI
? [
["github"],
["list"],
["html", { outputFolder: "playwright-report", open: "never" }],
]
: [
["list"],
['html', { outputFolder: 'playwright-report', open: 'never' }]
],

use: {
baseURL: BASE_URL,
Expand All @@ -34,10 +43,11 @@ export default defineConfig({
],

webServer: {
command: "npm run dev",
command: isCI ? "npm run build && npm run preview" : "npm run dev",
url: BASE_URL,
reuseExistingServer: true,
timeout: 180_000,
reuseExistingServer: !isCI,
timeout: isCI ? 900_000 : 180_000,
stdout: isCI ? "pipe" : "ignore",
env: {
A11Y_TEST: "1",
},
Expand Down
Loading