From 3ff20fd2c9137d598fb150dea3951f412e8b7ebd Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Mon, 2 Mar 2026 13:15:27 +0100 Subject: [PATCH] fix(ci): add chrome system libraries and fix pagespeed url parsing --- .gitea/workflows/qa.yml | 32 ++++++++++++++++++-------------- scripts/pagespeed-sitemap.ts | 6 +++++- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/qa.yml b/.gitea/workflows/qa.yml index ee6a0ac4..ca87cb38 100644 --- a/.gitea/workflows/qa.yml +++ b/.gitea/workflows/qa.yml @@ -43,8 +43,10 @@ jobs: run: | pnpm store prune pnpm install --no-frozen-lockfile - - name: 🌐 Install Chrome for Puppeteer - run: npx puppeteer browsers install chrome + - name: 🌐 Install Chrome & Dependencies + run: | + apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libasound2 libpango-1.0-0 libcairo2 + npx puppeteer browsers install chrome - name: 🌐 HTML Validation env: NEXT_PUBLIC_BASE_URL: ${{ env.TARGET_URL }} @@ -92,8 +94,10 @@ jobs: run: | pnpm store prune pnpm install --no-frozen-lockfile - - name: 🌐 Install Chrome for Puppeteer - run: npx puppeteer browsers install chrome + - name: 🌐 Install Chrome & Dependencies + run: | + apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libasound2 libpango-1.0-0 libcairo2 + npx puppeteer browsers install chrome - name: ♿ WCAG Scan continue-on-error: true env: @@ -132,18 +136,20 @@ jobs: run: | pnpm store prune pnpm install --no-frozen-lockfile - - name: 🌐 Install Chrome for Puppeteer - run: npx puppeteer browsers install chrome + - name: 🌐 Install Chrome & Dependencies + run: | + apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libasound2 libpango-1.0-0 libcairo2 + npx puppeteer browsers install chrome - name: 🎭 Desktop env: - LHCI_URL: ${{ env.TARGET_URL }} + NEXT_PUBLIC_BASE_URL: ${{ env.TARGET_URL }} GATEKEEPER_PASSWORD: ${{ secrets.GATEKEEPER_PASSWORD }} - run: pnpm run pagespeed:test -- --collect.settings.preset=desktop + run: pnpm run pagespeed:test -- ${{ env.TARGET_URL }} --collect.settings.preset=desktop - name: 📱 Mobile env: - LHCI_URL: ${{ env.TARGET_URL }} + NEXT_PUBLIC_BASE_URL: ${{ env.TARGET_URL }} GATEKEEPER_PASSWORD: ${{ secrets.GATEKEEPER_PASSWORD }} - run: pnpm run pagespeed:test -- --collect.settings.preset=mobile + run: pnpm run pagespeed:test -- ${{ env.TARGET_URL }} --collect.settings.preset=mobile # ──────────────────────────────────────────────────── # 4. Link Check & Dependency Audit @@ -176,15 +182,13 @@ jobs: run: | pnpm store prune pnpm install --no-frozen-lockfile - - name: 🌐 Install Chrome for Puppeteer - run: npx puppeteer browsers install chrome - name: 📦 Depcheck continue-on-error: true - run: pnpm dlx depcheck --ignores="*eslint*,*typescript*,*tailwindcss*,*postcss*,*prettier*,*@types/*,*husky*,*lint-staged*,*@next/*,*@lhci/*,*commitlint*,*cspell*,*rimraf*,*@payloadcms/*,*start-server-and-test*,*html-validate*,*critters*,*dotenv*,*turbo*" + run: pnpm dlx depcheck --ignores="*eslint*,*typescript*,*tailwindcss*,*postcss*,*prettier*,*@types/*,*husky*,*lint-staged*,*@next/*,*@lhci/*,*commitlint*,*cspell*,*rimraf*,*@payloadcms/*,*start-server-and-test*,*html-validate*,*critters*,*dotenv*,*turbo*" || true - name: 🔗 Lychee Link Check uses: lycheeverse/lychee-action@v2 with: - args: --accept 200,204,429 --timeout 15 content/ app/ public/ + args: --accept 200,204,429 --timeout 15 . fail: true # ──────────────────────────────────────────────────── diff --git a/scripts/pagespeed-sitemap.ts b/scripts/pagespeed-sitemap.ts index c537b0cd..f1198aea 100644 --- a/scripts/pagespeed-sitemap.ts +++ b/scripts/pagespeed-sitemap.ts @@ -12,7 +12,11 @@ import * as path from 'path'; * 3. Runs Lighthouse CI on those URLs */ -const targetUrl = process.argv[2] || process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000'; +const targetUrl = + process.argv[2] || + process.env.NEXT_PUBLIC_BASE_URL || + process.env.LHCI_URL || + 'http://localhost:3000'; const limit = process.env.PAGESPEED_LIMIT ? parseInt(process.env.PAGESPEED_LIMIT) : 20; // Default limit to avoid infinite runs const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';