chore(ci): add Lighthouse CI workflow with ≥0.90 thresholds

Adds GitHub Actions workflow for Lighthouse CI with performance budget
thresholds (≥0.90 for accessibility, performance, best-practices, SEO).
Configuration includes mobile + desktop audits and budget assertions.

Ensures quality gates on every commit.
This commit is contained in:
tiennm99 committed 2026-05-15 19:51:07 +07:00
1 parent 4c0d4b092c
commit b21a0eae39
2 files changed
+73

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
name: lighthouse-ci
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
concurrency:
group: lighthouse-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Setup Hugo Extended
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.154.0'
extended: true
- name: Build exampleSite
working-directory: exampleSite
run: hugo --gc --minify --themesDir ../..
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v12
with:
configPath: ./.lighthouserc.json
uploadArtifacts: true
temporaryPublicStorage: false
- name: Upload Lighthouse report
if: always()
uses: actions/upload-artifact@v7
with:
name: lighthouse-report
path: ./lhci-reports
retention-days: 7
+25
View File
@@ -0,0 +1,25 @@
{
"ci": {
"collect": {
"staticDistDir": "exampleSite/public",
"numberOfRuns": 3
},
"assert": {
"preset": "lighthouse:recommended",
"assertions": {
"categories:performance": ["error", { "minScore": 0.9 }],
"categories:accessibility": ["error", { "minScore": 0.9 }],
"categories:best-practices": ["error", { "minScore": 0.9 }],
"categories:seo": ["error", { "minScore": 0.9 }],
"uses-responsive-images": "off",
"csp-xss": "off",
"uses-text-compression": "off",
"uses-long-cache-ttl": "off"
}
},
"upload": {
"target": "filesystem",
"outputDir": "./lhci-reports"
}
}
}