Makes Lighthouse performance report-only in CI
Lighthouse slows the CPU 4x relative to the measuring machine, so the Raspberry Pi runner scores performance 30-40 points lower than a PC for the same build. In CI the performance assertions now only warn; accessibility, best practices and SEO still block, and performance still blocks in `pnpm check` on a PC. Mobile and desktop reports go to separate folders and are attached to every run as an artifact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -16,8 +16,8 @@ pnpm lighthouse # mobile (lighthouserc.cjs), then desktop (lighthouserc.deskto
|
||||
```
|
||||
- Lighthouse CI starts `pnpm preview` itself (port 4173, real security headers).
|
||||
- It measures all six routes plus `/bestaat-niet` (404) once per form factor.
|
||||
- It fails if any assertion fails.
|
||||
- Reports are written to `.lighthouseci/` (git-ignored). Open the `.html` files for details.
|
||||
- It fails if any assertion fails. Exception: in CI the workflow sets `LIGHTHOUSE_PERFORMANCE=warn`, which makes Performance report-only, because the Raspberry Pi runner gives scores 30-40 points lower than a PC for the same build. Locally, Performance blocks.
|
||||
- Reports are written to `lighthouse-reports/mobile` and `lighthouse-reports/desktop` (git-ignored). Open the `.html` files for details. In CI they are attached to the run as the `lighthouse-reports` artifact.
|
||||
- Requires a local Chrome.
|
||||
|
||||
Manual measurement in a browser: `pnpm build && pnpm preview`, then open `http://localhost:4173` in a **private window** (extensions and Brave Shields skew results) and run Lighthouse from DevTools.
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ Text alternative: `pnpm check` runs lint, tests (including property-based and ac
|
||||
|
||||
| ID | Requirement | Measure | Source |
|
||||
|---|---|---|---|
|
||||
| NFR-P-01 | Lighthouse Performance ≥ 90, mobile and desktop, on every route. **Exception (temporary): home page on mobile ≥ 80**, until responsive images come from the API/CMS and prerendering exists (measured 0.81–0.82). | `pnpm lighthouse` against `pnpm preview` | Q3 = B; code change Q1 = B |
|
||||
| NFR-P-01 | Lighthouse Performance ≥ 90, mobile and desktop, on every route. **Exception (temporary): home page on mobile ≥ 80**, until responsive images come from the API/CMS and prerendering exists (measured 0.81–0.82). | `pnpm lighthouse` against `pnpm preview`. **Blocking locally** (`pnpm check` on a PC). **Report-only in CI**, because the Raspberry Pi runner is too slow for representative performance scores (Lighthouse slows the CPU 4x relative to the host); reports are attached to every run. | Q3 = B; code change Q1 = B; Lighthouse CI question A |
|
||||
| NFR-P-02 | No layout shift from shell elements: images have `width`/`height`, fonts are self-hosted | Lighthouse CLS ≤ 0.1 | BR-SEO-10 |
|
||||
| NFR-P-03 | The shell adds no network requests beyond bundled assets | No third-party origins in the network log | NFR-05 |
|
||||
| NFR-P-04 | Router devtools are not in the production bundle | Build output does not contain the devtools chunk | SECURITY-09 |
|
||||
|
||||
Reference in New Issue
Block a user