Skip to content
Draft
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
50 changes: 50 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Accessibility (Lighthouse Accessibility / Performance Scan)

on:
pull_request:
branches: [main]
# Run at 13:00 on the first day of each month
schedule:
- cron: "0 13 1 * *"

jobs:
lighthouse:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
pages: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Build site
run: npm run build

- name: Create Lighthouse CI config
run: node ./scripts/extract-routes.js > ./.lighthouserc.json

- name: Run Lighthouse CI (auto-attach artifact)
uses: treosh/lighthouse-ci-action@v12
with:
configPath: ./.lighthouserc.json
uploadArtifacts: true
artifactName: lighthouse-reports
temporaryPublicStorage: false

- name: List report dirs
if: always()
run: |
echo "Root contents:" && ls -la
echo ".lighthouseci contents:" && ls -la .lighthouseci || true
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ docs
*.njsproj
*.sln
*.sw?
*.sql
*.sql


# Lighthouse
.lighthouseci/*
.lighthouserc.gen.json
26 changes: 26 additions & 0 deletions .lighthouserc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"ci": {
"collect": {
"url": ["http://localhost:4173/"],
"startServerCommand": "cd src && npm run build && npm run preview -- --port 4173 --strictPort",
"numberOfRuns": 1,
"settings": {
"preset": "desktop"
}
},
"assert": {
"assertions": {
"categories:accessibility": [
"error",
{
"minScore": 0.9
}
]
}
},
"upload": {
"target": "filesystem",
"outputDir": "./.lighthouseci"
}
}
}
Loading