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 6b31e60617
commit 2a4f0207c5
2 changed files with 23 additions and 8 deletions

View file

@ -34,14 +34,21 @@ jobs:
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install dependencies - name: Retrieve Vercel Preview URL
run: npm install 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 - name: Await Vercel Deployment
run: npm run build uses: UnlyEd/github-action-await-vercel@v1.2.43
env:
- name: Start Preview and Get Preview URL VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: npm run preview -- --port=${{ env.PORT }} & echo $! > preview_pid with:
deployment-url: ${{ steps.vercel_preview_url.outputs.preview_url }}
timeout: 120
- name: Install Dependencies - name: Install Dependencies
run: npm add -g @unlighthouse/cli puppeteer run: npm add -g @unlighthouse/cli puppeteer
@ -49,7 +56,7 @@ jobs:
- name: Run Unlighthouse - name: Run Unlighthouse
run: | run: |
unlighthouse-ci \ unlighthouse-ci \
--site "http://localhost:${{ env.PORT }}" \ --site "${{ steps.vercel_preview_url.outputs.preview_url }}" \
--reporter jsonExpanded \ --reporter jsonExpanded \
--build-static --build-static

8
unlighthouse.config.ts Normal file
View file

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