feat: unlighthouse configuration and dependencies

This commit is contained in:
Bart van der Braak 2024-02-18 22:21:07 +01:00
parent 5aa27c86a5
commit ab161e0b91
5 changed files with 3034 additions and 10 deletions

View file

@ -75,13 +75,17 @@ jobs:
- name: Install Dependencies
run: pnpm install -g @unlighthouse/cli puppeteer
- name: Run Unlighthouse
run: |
unlighthouse-ci \
--site "${{ github.ref == 'refs/heads/main' && env.WEBSITE_URL || steps.vercel_preview_url.outputs.preview_url }}" \
--reporter jsonExpanded \
--build-static
export SCAN_URL=${{ github.ref == 'refs/heads/main' && env.WEBSITE_URL || steps.vercel_preview_url.outputs.preview_url }}
export AUTH_COOKIE=$(curl '$SCAN_URL/auth?/login' \
-H 'Origin: $SCAN_URL' \
-F "email=test_user" \
-F "password=${{ secrets.TEST_USER_PASSWORD }}" \
--verbose 2>&1 | awk -F'pb_auth=' '/pb_auth/{print $2;exit}' | awk -F';' '{print $1}')
unlighthouse-ci
- name: Upload report to Cloudflare pages
uses: cloudflare/wrangler-action@v3.4.1