Repository navigation
75 lines (63 loc) · 2.13 KB
/
Copy pathwebsite-lighthouse.yml
File metadata and controls
75 lines (63 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Website Lighthouse
on:
pull_request:
paths:
- 'apps/website/**'
- 'packages/ui/**'
- 'packages/shared/**'
- '.github/workflows/website-lighthouse.yml'
- 'package.json'
- 'pnpm-lock.yaml'
permissions:
contents: read
concurrency:
group: website-lighthouse-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PNPM_VERSION: '11.9.0'
NODE_VERSION: '26.10.0'
jobs:
lighthouse:
name: Lighthouse CI (${{ matrix.formFactor }})
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
formFactor: [mobile, desktop]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies (frozen)
run: pnpm install --frozen-lockfile
- name: Build website
run: pnpm build:website
- name: Install Chromium for Lighthouse
run: pnpm exec playwright install chromium
- name: Run Lighthouse CI
env:
LHCI_FORM_FACTOR: ${{ matrix.formFactor }}
LHCI_NUMBER_OF_RUNS: '1'
run: |
export CHROME_PATH
CHROME_PATH="$(node -e "const {chromium}=require('playwright'); console.log(chromium.executablePath())")"
test -n "$CHROME_PATH"
test -x "$CHROME_PATH"
npx --yes @lhci/cli@0.15.1 autorun --config=apps/website/lighthouserc.cjs
- name: Upload Lighthouse reports
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: website-lighthouse-${{ matrix.formFactor }}-${{ github.sha }}-${{ github.run_id }}
path: .lighthouseci/${{ matrix.formFactor }}/
if-no-files-found: ignore
retention-days: 14