feat(ci): add automated Lighthouse audit pipeline #2

Merged
Lucas merged 12 commits from develop into master 2026-01-12 11:53:24 +00:00
2 changed files with 36 additions and 0 deletions
Showing only changes of commit c270b631dd - Show all commits

22
.lighthouserc.cjs Normal file
View File

@@ -0,0 +1,22 @@
module.exports = {
ci: {
collect: {
staticDistDir: '/app/dist',
settings: {
chromeFlags: '--no-sandbox --disable-setuid-sandbox --headless=new --disable-gpu --disable-dev-shm-usage',
},
numberOfRuns: 1
},
assert: {
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}],
},
},
upload: {
target: 'temporary-public-storage',
},
},
};

14
local-lighthouse.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
mkdir -p ./.lighthouseci
docker run --rm \
--user 0:0 \
-v ./dist:/app/dist \
-v ./.lighthouserc.cjs:/app/.lighthouserc.cjs \
-v ./.lighthouseci:/app/.lighthouseci \
-w /app \
-e CHROME_PATH=/usr/bin/chromium-browser \
zenika/alpine-chrome:with-node \
npx @lhci/cli@0.15.x collect \
--config=/app/.lighthouserc.cjs