Skip to content

Commit 7b92e17

Browse files
Ajit Pratap Singhclaude
authored andcommitted
ci: add automated Lighthouse CI checks for website
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b247866 commit 7b92e17

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"ci": {
3+
"assert": {
4+
"assertions": {
5+
"categories:performance": ["warn", { "minScore": 0.85 }],
6+
"categories:accessibility": ["error", { "minScore": 0.95 }],
7+
"categories:seo": ["error", { "minScore": 0.95 }],
8+
"categories:best-practices": ["warn", { "minScore": 0.85 }]
9+
}
10+
}
11+
}
12+
}

.github/workflows/lighthouse.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Lighthouse CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'website/**'
8+
pull_request:
9+
paths:
10+
- 'website/**'
11+
workflow_dispatch:
12+
13+
jobs:
14+
lighthouse:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '22'
24+
cache: 'npm'
25+
cache-dependency-path: website/package-lock.json
26+
27+
- name: Install and build website
28+
run: |
29+
cd website
30+
npm ci
31+
npm run build
32+
33+
- name: Start local server
34+
run: |
35+
cd website
36+
npx serve out -l 3000 &
37+
sleep 3
38+
39+
- name: Run Lighthouse
40+
uses: treosh/lighthouse-ci-action@v12
41+
with:
42+
urls: |
43+
http://localhost:3000/
44+
http://localhost:3000/playground
45+
http://localhost:3000/docs
46+
configPath: '.github/lighthouse/lighthouserc.json'
47+
uploadArtifacts: true
48+
49+
- name: Check scores
50+
run: |
51+
echo "Lighthouse audit complete. Check artifacts for detailed results."

0 commit comments

Comments
 (0)