U6: Lighthouse-gate in CI (mobiel+desktop >= 0.9), font-preload hero, privacyopzet bijgewerkt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,8 @@ concurrency:
|
||||
env:
|
||||
NODE_VERSION: '20'
|
||||
PNPM_VERSION: '9'
|
||||
# Chromium voor Lighthouse (zelfde aanpak als de ASF-site)
|
||||
PLAYWRIGHT_VERSION: '1.55.0'
|
||||
ARTIFACT_NAME: dist
|
||||
ARTIFACT_NAME_PRODUCTION: dist-production
|
||||
ARTIFACT_PATH: dist/
|
||||
@@ -257,6 +259,66 @@ jobs:
|
||||
- name: Unit tests
|
||||
run: pnpm run test
|
||||
|
||||
# Lighthouse CI tegen de gebouwde site (dist/ uit de build-job; mobiel en desktop).
|
||||
# Alle vier de categorieen moeten >= 0,9 halen (NFR-9). Deploy-test wacht hier
|
||||
# bewust niet op (de testomgeving is om te testen, rapporten zie je in de
|
||||
# artifacts); deploy-production wel: niets gaat live als Lighthouse faalt.
|
||||
lighthouse:
|
||||
needs: build
|
||||
runs-on: linux
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-store
|
||||
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Restore pnpm store
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.pnpm-store.outputs.path }}
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACT_NAME }}
|
||||
path: ${{ env.ARTIFACT_PATH }}
|
||||
|
||||
- name: Install Chromium
|
||||
run: |
|
||||
pnpm dlx playwright@${{ env.PLAYWRIGHT_VERSION }} install --with-deps chromium
|
||||
CHROME_PATH="$(find "$HOME/.cache/ms-playwright" -path '*chrome-linux*' -name chrome -type f | head -n 1)"
|
||||
test -x "$CHROME_PATH"
|
||||
echo "CHROME_PATH=$CHROME_PATH" >> "$GITHUB_ENV"
|
||||
"$CHROME_PATH" --version
|
||||
|
||||
# Chrome in een container: --no-sandbox (als root weigert Chrome anders te
|
||||
# starten) en --disable-dev-shm-usage (/dev/shm is maar 64 MB).
|
||||
- name: Lighthouse
|
||||
env:
|
||||
LIGHTHOUSE_CHROME_FLAGS: '--no-sandbox --headless=new --disable-dev-shm-usage'
|
||||
run: pnpm run lighthouse
|
||||
|
||||
- name: Upload Lighthouse-rapporten
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: lighthouse-reports
|
||||
path: lighthouse-reports/
|
||||
retention-days: 14
|
||||
|
||||
deploy-test:
|
||||
needs: [build, test, config]
|
||||
# De push-naar-master-conditie hieronder is bewust ONAFHANKELIJK van het
|
||||
@@ -285,7 +347,7 @@ jobs:
|
||||
# niemand per ongeluk productie deployen door simpelweg naar master te
|
||||
# pushen of de workflow handmatig te starten zonder dat vinkje.
|
||||
deploy-production:
|
||||
needs: [build-production, test, config]
|
||||
needs: [build-production, test, lighthouse, config]
|
||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_production == 'true'
|
||||
uses: ./.gitea/workflows/deploy.yaml
|
||||
secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user