Skip to content

ci: hold the page to its Lighthouse budget - #18

Merged
benatespina merged 1 commit into
mainfrom
claude/lighthouse-ci
Oct 30, 2026
Merged

benatespina merged 1 commit into
mainfrom
claude/lighthouse-ci

Conversation

@benatespina

@benatespina benatespina commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

A Lighthouse job in CI, so the 100 from #17 cannot regress unnoticed.

  • scripts/lighthouse.mjs serves dist/ with Astro's preview server, audits the page on the mobile default and the desktop preset, takes the median of three runs and fails under the budget: 95 in performance (slack for the runner) and 100 in accessibility, best practices and SEO. It names the weighted audits that cost the points, writes the step summary and keeps HTML and JSON reports in lighthouse-reports/.
  • The Cloudflare beacon is blocked during the audit (Lighthouse ignores the console errors of blocked requests), so the check works offline and never fails on a third party.
  • The job runs in parallel with Build and uploads the reports as an artifact whatever the outcome. pnpm build && pnpm lighthouse runs the same check locally; --runs=1 for a quick look.
  • lighthouse is a pinned devDependency; actions/upload-artifact is pinned by SHA like the other actions.

Verification

  • pnpm lighthouse on current main: 100 in every category on both presets, median of three, 70 s.
  • A forced regression (a 900 ms blocking script in the head of dist/index.html) takes mobile performance to 73 and the script exits 1.
  • pnpm check passes.

Nothing protected the Lighthouse scores: a change could take the hero back
behind a script or three.js back onto the main thread and CI would stay green.

scripts/lighthouse.mjs serves dist/ with Astro's preview server, audits the
page on the mobile default and the desktop preset, takes the median of three
runs and fails under the budget: 95 in performance, with a little slack for
the runner, and 100 in accessibility, best practices and SEO. It prints the
scores with LCP, TBT and CLS, names the weighted audits that cost the points,
writes the GitHub step summary, and keeps the HTML and JSON reports in
lighthouse-reports/. The Cloudflare beacon is blocked during the audit, so an
offline run or a third party's outage never counts against the page.

CI runs it in its own job, in parallel with Build, so a slow runner cannot
hide a type error, and uploads the reports whatever the outcome. Locally,
`pnpm build && pnpm lighthouse` does the same; `--runs=1` for a quick look.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
bounda-website f87a29b Oct 30 2026, 10:34 PM

@benatespina
benatespina merged commit 0d3f495 into main Oct 30, 2026
3 checks passed
@benatespina
benatespina deleted the claude/lighthouse-ci branch October 30, 2026 22:44
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.

1 participant