Makes Lighthouse performance report-only in CI
Continuous Integration / check (pull_request) Successful in 5m56s
Continuous Integration / lighthouse (pull_request) Successful in 12m13s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / deploy-production (pull_request) Skipped

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:
2026-10-19 01:23:06 +02:00
co-authored by Claude Opus 5.5
parent 295adc2a9c
commit 23f7020ff5
11 changed files with 77 additions and 9 deletions
+12 -4
View File
@@ -21,8 +21,15 @@ const notFoundPath = '/bestaat-niet';
// afbeeldingen uit de API/CMS en prerendering (NFR-P-01).
const homeMobilePerformance = 0.8;
// Performance hangt af van de snelheid van de meetmachine: Lighthouse vertraagt
// de CPU 4x ten opzichte van een snelle desktop. Op de CI-runner (Raspberry Pi)
// valt de score daardoor 30-40 punten lager uit dan op een pc. In CI daarom
// alleen melden (LIGHTHOUSE_PERFORMANCE=warn); lokaal in `pnpm check` blokkerend.
const performanceLevel =
process.env.LIGHTHOUSE_PERFORMANCE === 'warn' ? 'warn' : 'error';
const quality = {
'categories:performance': ['error', { minScore: 0.9 }],
'categories:performance': [performanceLevel, { minScore: 0.9 }],
'categories:accessibility': ['error', { minScore: 1 }],
'categories:best-practices': ['error', { minScore: 1 }],
};
@@ -40,6 +47,7 @@ const escape = (path) => path.replace(/[.*+?^${}()|[\]\\/]/g, '\\$&');
const exact = (paths) => `^${origin}(${paths.map(escape).join('|')})$`;
module.exports = {
performanceLevel,
indexedPaths,
noindexPaths,
notFoundPath,
@@ -66,7 +74,7 @@ module.exports = {
assertions: {
...quality,
'categories:performance': [
'error',
performanceLevel,
{ minScore: homeMobilePerformance },
],
'categories:seo': ['error', { minScore: 1 }],
@@ -88,9 +96,9 @@ module.exports = {
],
},
upload: {
// Resultaten blijven lokaal in .lighthouseci/
// HTML- en JSON-rapporten per meting; in CI als download bij de run
target: 'filesystem',
outputDir: '.lighthouseci',
outputDir: 'lighthouse-reports/mobile',
},
},
};