ci(lighthouse): stop lhci reading the form factor as a CLI flag

lhci treats every LHCI_* environment variable as a command-line option, so
LHCI_PRESET=mobile reached `lhci assert` as an invalid --preset and failed
both jobs after the audits had run. Use LIGHTHOUSE_FORM_FACTOR instead.

Also upload the reports: upload-artifact v4+ skips dot-directories such as
.lighthouseci unless include-hidden-files is set.
This commit is contained in:
Josh Creek
2026-09-14 21:19:20 +01:00
parent 5d41462d35
commit 7603116369
3 changed files with 12 additions and 7 deletions
+6 -3
View File
@@ -86,7 +86,7 @@ jobs:
strategy:
fail-fast: false
matrix:
preset: [mobile, desktop]
form-factor: [mobile, desktop]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
@@ -97,13 +97,16 @@ jobs:
# The homepage streams public stats from the database, so audit against a real stack.
- run: npx supabase start
- run: npm run test:lighthouse
# Not LHCI_*: lhci reads any LHCI_ variable as a CLI flag (LHCI_PRESET became `--preset`).
env:
LHCI_PRESET: ${{ matrix.preset }}
LIGHTHOUSE_FORM_FACTOR: ${{ matrix.form-factor }}
- uses: actions/upload-artifact@v6
if: always()
with:
name: lighthouse-${{ matrix.preset }}
name: lighthouse-${{ matrix.form-factor }}
path: .lighthouseci/
# upload-artifact v4+ skips dot-directories unless told otherwise.
include-hidden-files: true
if-no-files-found: ignore
- if: always()
run: npx supabase stop