Lighthouse CI audits three key routes on every PR to catch regressions in
performance, accessibility, best-practices, and SEO before they reach main.
| Route | Purpose |
|---|---|
/ |
Landing page (heavy animations, hero assets) |
/marketplace |
Commitment listing (recharts, data tables) |
/commitments |
Dashboard (live SSE stream, health charts) |
| Category | Threshold | Failure Mode |
|---|---|---|
| Performance | ≥ 70 | warn |
| Accessibility | ≥ 90 | error (blocks merge) |
| Best Practices | ≥ 90 | error (blocks merge) |
| SEO | ≥ 90 | error (blocks merge) |
| Metric | Budget | Failure Mode |
|---|---|---|
| First Contentful Paint (FCP) | ≤ 3 000 ms | warn |
| Largest Contentful Paint (LCP) | ≤ 4 000 ms | warn |
| Total Blocking Time (TBT) | ≤ 500 ms | warn |
| Cumulative Layout Shift (CLS) | ≤ 0.15 | warn |
| Time to Interactive (TTI) | ≤ 5 000 ms | warn |
error thresholds block the PR. warn thresholds surface in the CI report
but do not block merge, allowing iterative improvement.
npm install -g @lhci/cli# 1. Build the production app
npm run build
# 2. Start the production server in one terminal
npm start
# 3. In a second terminal, run the audit
lhci autorunReports are written to .lighthouseci/. Open any .html file in a browser
for a full visual report.
npm run build && lhci autorunlhci collect --url=http://localhost:3000/ --numberOfRuns=1
lhci assertEdit lighthouserc.json at the repo root. The assert.assertions block maps
Lighthouse audit keys to [severity, { threshold }] pairs.
"categories:performance": ["warn", { "minScore": 0.7 }]Raise the threshold to tighten the budget; switch "warn" to "error" to
make it a blocking failure.
Setting the LHCI_GITHUB_APP_TOKEN repository secret enables inline PR
comments with score deltas. Without it, results are uploaded to Lighthouse
CI's temporary public storage and linked from the workflow summary.
See the Lighthouse CI docs for instructions on installing the GitHub App.