Skip to content

Commit b960d06

Browse files
authored
ci: add lighthouse accessibility testing job (#85)
1 parent 091b63f commit b960d06

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,25 @@ jobs:
7373

7474
- name: 🖥️ Test project (browser)
7575
run: pnpm test:browser
76+
77+
a11y:
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- uses: actions/checkout@v6
82+
- run: corepack enable
83+
- uses: actions/setup-node@v6
84+
with:
85+
node-version: lts/*
86+
cache: pnpm
87+
88+
- name: 📦 Install dependencies
89+
run: pnpm install
90+
91+
- name: 🏗️ Build project
92+
run: pnpm build
93+
94+
- name: ♿ Accessibility audit (Lighthouse)
95+
run: pnpx @lhci/cli autorun
96+
env:
97+
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ coverage/
3333
# Playwright
3434
playwright-report/
3535
test-results/
36+
37+
# Lighthouse
38+
.lighthouseci

.lighthouserc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"ci": {
3+
"collect": {
4+
"startServerCommand": "pnpm preview",
5+
"startServerReadyPattern": "Listening",
6+
"url": [
7+
"http://localhost:3000/",
8+
"http://localhost:3000/search?q=nuxt",
9+
"http://localhost:3000/nuxt"
10+
],
11+
"numberOfRuns": 1,
12+
"settings": {
13+
"onlyCategories": ["accessibility"],
14+
"skipAudits": ["valid-source-maps"]
15+
}
16+
},
17+
"assert": {
18+
"assertions": {
19+
"categories:accessibility": ["warn", { "minScore": 0.9 }]
20+
}
21+
},
22+
"upload": {
23+
"target": "temporary-public-storage"
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)