refactor: run lighthouse accurate on vercel target

This commit is contained in:
Bart van der Braak 2023-08-18 10:36:14 +02:00
parent db02a217b1
commit 176d58ab41
2 changed files with 23 additions and 9 deletions

View file

@ -40,15 +40,21 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Retrieve Vercel Preview URL
uses: zentered/vercel-preview-url@v1.1.9
id: vercel_preview_url
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
with:
vercel_project_id: ${{ vars.VERCEL_PROJECT_ID }}
- name: Build production
run: pnpm run build
- name: Start Preview and Get Preview URL
run: |
pnpm run preview --port ${{ env.PORT }} & echo $! > preview_pid
- name: Await Vercel Deployment
uses: UnlyEd/github-action-await-vercel@v1.2.43
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
with:
deployment-url: ${{ steps.vercel_preview_url.outputs.preview_url }}
timeout: 120
- name: Install Dependencies
run: pnpm add -g @unlighthouse/cli puppeteer
@ -56,7 +62,7 @@ jobs:
- name: Run Unlighthouse
run: |
unlighthouse-ci \
--site "http://localhost:${{ env.PORT }}" \
--site "${{ steps.vercel_preview_url.outputs.preview_url }}" \
--reporter jsonExpanded \
--build-static

8
unlighthouse.config.ts Normal file
View file

@ -0,0 +1,8 @@
export default {
scanner: {
samples: 3
},
puppeteerClusterOptions: {
maxConcurrency: 1
}
};