Skip to content

ci: add the shared nightly Lighthouse workflow - #4

Merged
alexgrozav merged 2 commits into
mainfrom
shared-lighthouse-workflow-uxf-1078
Nov 26, 2026
Merged

alexgrozav merged 2 commits into
mainfrom
shared-lighthouse-workflow-uxf-1078

Conversation

@alexgrozav

@alexgrozav alexgrozav commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Five repositories each run Lighthouse their own way, on every pull request, and nothing shared schedules it or checks whether anything changed. This adds a reusable workflow that a repository calls on a nightly schedule, and that audits only when the branch moved since the last audit.

  • .github/workflows/lighthouse.yml (workflow_call) has two jobs:
    • Changes (actions: read) finds the caller's workflow, walks back through its completed runs on the same branch, newest first, to the last one whose Audit job passed, failed or timed out, and decides. A scheduled run skips only when the branch is still at that run's commit. Every other event audits. A failed lookup fails the run. The decision and its reason go to the job summary.
    • Audit (contents: read) installs, builds and runs the caller's audit command, each from an environment variable as release.yml does, then uploads the reports as lighthouse-reports for 14 days, after a failed audit too.
  • .github/workflows/lighthouse-test.yml calls this branch's own copy on each pull request that changes it, against a fixture page in test/lighthouse/ that must score 0.9 in every category. It passes no install and explicit Node.js and pnpm versions, since this repository has no package.json or .node-version.
  • README.md documents the workflow, the caller's file, its inputs, the permissions, how the change check decides and the self-test.

Actions are pinned to the same SHAs as release.yml, and upload-artifact to the one the callers' ci.yml files pin. Nothing calls the workflow yet, so merging it changes no other repository.

How it was checked

  • actionlint .github/workflows/lighthouse.yml .github/workflows/lighthouse-test.yml exits 0, with shellcheck on the run: scripts.
  • pnpm dlx prettier@3 --check . passes.
  • pnpm dlx @lhci/cli@0.16.1 autorun --config=test/lighthouse/lighthouserc.json scores 1 in every category locally.
  • The Lighthouse self-test passes on this pull request: Changes and Audit succeed on both pushes, and each run uploads lighthouse-reports with the lhr-*.json reports.
  • The decision script, run outside Actions against this branch's run history, skips for an unchanged branch, audits for a moved one and audits for a manual run. With a run id that doesn't exist, the lookup fails and the script exits 1 without writing a decision.

Checklist

  • The title follows Conventional Commits, like fix(button): keep focus after submit.
  • The checks the repository's README lists pass.
  • If the repository has a .changeset/ folder, this pull request adds a changeset.
  • If behaviour changed, the docs say so.

alexgrozav and others added 2 commits November 25, 2026 22:56
A reusable workflow that audits a repository's site only when its branch moved since the last audit, plus a self-test that calls it against a fixture page on each pull request that changes it.

Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
@alexgrozav
alexgrozav marked this pull request as ready for review November 25, 2026 21:56
@alexgrozav
alexgrozav merged commit d2f86bc into main Nov 26, 2026
2 checks passed
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