Skip to content

Commit 2b5ff8f

Browse files
brabojclaude
andcommitted
feat: add Lighthouse CI workflow for quality scoring
Audits 4 pages on every PR: performance, accessibility, best practices, SEO. Accessibility < 90 blocks merge; others warn at < 90. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7c5b906 commit 2b5ff8f

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/lighthouse.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Lighthouse CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lighthouse:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "22.12.0"
19+
cache: npm
20+
cache-dependency-path: astro-site/package-lock.json
21+
22+
- name: Install dependencies
23+
working-directory: astro-site
24+
run: npm ci
25+
26+
- name: Create assets symlink
27+
run: mkdir -p astro-site/src/content && ln -s ../../../assets astro-site/src/content/assets
28+
29+
- name: Build site
30+
working-directory: astro-site
31+
run: npm run build
32+
33+
- name: Lighthouse CI
34+
uses: treosh/lighthouse-ci-action@v12
35+
with:
36+
configPath: ./lighthouserc.json
37+
uploadArtifacts: true

lighthouserc.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"ci": {
3+
"collect": {
4+
"staticDistDir": "./astro-site/dist",
5+
"url": [
6+
"/tutorial-git/",
7+
"/tutorial-git/introduction/",
8+
"/tutorial-git/building-blocks/",
9+
"/tutorial-git/branching-and-merging/"
10+
]
11+
},
12+
"assert": {
13+
"assertions": {
14+
"categories:performance": ["warn", { "minScore": 0.9 }],
15+
"categories:accessibility": ["error", { "minScore": 0.9 }],
16+
"categories:best-practices": ["warn", { "minScore": 0.9 }],
17+
"categories:seo": ["warn", { "minScore": 0.9 }]
18+
}
19+
},
20+
"upload": {
21+
"target": "temporary-public-storage"
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)