Skip to content
Merged
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
59 changes: 59 additions & 0 deletions .github/workflows/accessibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Accessibility

on:
pull_request:
branches:
- main
- next
paths:
- ".github/workflows/accessibility.yml"
- "astro.config.*"
- "package.json"
- "playwright.config.*"
- "pnpm-lock.yaml"
- "public/**"
- "src/**"
- "tests/**"
- "tsconfig.json"
push:
branches:
- main
- next
paths:
- ".github/workflows/accessibility.yml"
- "astro.config.*"
- "package.json"
- "playwright.config.*"
- "pnpm-lock.yaml"
- "public/**"
- "src/**"
- "tests/**"
- "tsconfig.json"
workflow_dispatch:
permissions:
contents: read
env:
FORCE_COLOR: 1

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set Up PNPM
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9

- name: Set Up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Run Accessibility Audit
run: pnpm test:ci
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# build output
dist/
playwright-report/
test-results/
# generated types
.astro/

Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@
"prebuild": "node ./scripts/sync-governance.mjs",
"build": "astro build",
"preview": "astro preview",
"preview:test": "pnpm run build && astro preview --port 8787",
"sync:governance": "node ./scripts/sync-governance.mjs",
"astro": "astro",
"upgrade:astro": "pnpm dlx @astrojs/upgrade --all",
"format": "prettier --write ."
"format": "prettier --write .",
"test": "playwright install --with-deps chromium && playwright test",
"test:ci": "playwright test"
},
"dependencies": {
"astro": "^6.1.9"
},
"devDependencies": {
"@astrojs/upgrade": "^0.7.2",
"@axe-core/playwright": "^4.12.1",
"@playwright/test": "^1.62.0",
"@types/node": "^26.1.1",
"prettier": "^3.8.0"
}
}
40 changes: 40 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { defineConfig, devices } from "@playwright/test";

const isCI = !!process.env["CI"];

export default defineConfig({
forbidOnly: isCI,
fullyParallel: true,
projects: [
{
name: "Chrome",
use: {
...devices["Desktop Chrome"],
channel: isCI ? "chrome" : undefined,
headless: true,
},
},
{
name: "Mobile Chrome",
use: {
...devices["Pixel 5"],
channel: isCI ? "chrome" : undefined,
headless: true,
},
},
],
reporter: "list",
testDir: "./tests",
testMatch: /.*\.test\.ts/,
// The timeout for the accessibility tests only.
timeout: 180 * 1_000,
webServer: [
{
command: "pnpm run preview:test",
reuseExistingServer: !isCI,
// The timeout of the single build step ran before the accessibility tests.
timeout: 120 * 1_000,
url: "http://localhost:8787",
},
],
});
111 changes: 104 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading