Menu

Fail CI when Lighthouse budgets slip: GitHub Actions + a hosted audit
πŸ“°

Fail CI when Lighthouse budgets slip: GitHub Actions + a hosted audit

DEV Community: javascriptΒ·Jerry LinΒ·about 3 hours ago
#nxxlAris
#devtojavascript#devto#dev#anchor#lighthouse
Reading 0:00
15s threshold

Lighthouse is a lab test. Run it twice on the same URL and the performance score often moves a few points. That is normal: CPU contention, network jitter, and third-party scripts all wobble the result.

If you only glance at PageSpeed Insights before a launch, a regression can ship between glances. A more useful habit is to set a performance budget and let CI fail the deploy when the budget misses.

This post walks through a complete GitHub Actions job that:

Runs real Google Lighthouse on a public URL (mobile and desktop).

Repeats the audit up to three times and reports the median run, so one noisy measurement does not fail the build.

Fails the workflow when the score or Core Web Vitals miss limits you chose.

I will use an Apify Actor I built for the hosted run, and I will say so clearly at the end.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.