Skip to content

CI: run Lighthouse beside the checks, once per URL on pull requests - #84

Open
jbspeakr wants to merge 1 commit into
mainfrom
ci/parallel-lighthouse
Open

jbspeakr wants to merge 1 commit into
mainfrom
ci/parallel-lighthouse

Conversation

@jbspeakr

Copy link
Copy Markdown
Collaborator

Why

283 CI runs in the last 30 days at ~8.6 minutes each. The repository is public, so this costs no quota, but 5.8 of those minutes are Lighthouse — 12 URLs × 3 runs — sitting at the end of the job behind the end-to-end tests, so every pull request waits almost nine minutes for a verdict that is mostly available after three.

What changes

  • Lighthouse gets its own job that builds the site itself (seconds) and runs in parallel with the checks. Expected wall time for a pull request: ~3 minutes instead of ~8.6.
  • Pull requests audit each URL once; main keeps three runs. Main's scores become the commit status and gate the site and scanner deploys, so the noise tolerance stays where a flaky failure would hurt. On pull requests a borderline score shows up as a single failing run that a push can retry.
  • Playwright's Chromium is cached on the lockfile in ci.yml and screenshots.yml. The lockfile pins the Playwright version and with it the Chromium build the screenshot baselines depend on, so a cache hit can never hand a test a different browser than a fresh install would. A hit skips the download and the apt run of --with-deps (~0.6 min per run).
  • docs/development.md describes the new shape.

Check names

The checks job keeps its name (Validate, lint, test, build). The new job is Lighthouse budgets; if main has a required-checks rule, it may want adding there. Both deploy workflows trigger on the CI workflow conclusion, which covers both jobs, so nothing changes for them.


Generated by Claude Code

A CI run took about 8.6 minutes, 5.8 of them in Lighthouse (12 URLs x 3
runs) waiting behind the end-to-end tests; 283 runs in the last 30
days.

- Lighthouse moves to its own job that builds the site (seconds) and
  runs in parallel with the checks. Pull requests audit each URL once;
  main keeps three runs, since its scores become the commit status and
  a flaky failure there would hold back a deploy.
- Playwright's Chromium is cached on the lockfile in ci.yml and
  screenshots.yml; the lockfile pins the Playwright version and with it
  the browser build the screenshot baselines depend on. A hit skips
  the download and the apt run.

docs/development.md describes the new shape.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175HbpkZkWEk4P8gomAdRTL

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants