Skip to content

ci: split the ci job into check, unit, lint and build jobs - #267

Draft
ruifigueira wants to merge 2 commits into
mainfrom
rfigueira/split-ci
Draft

ruifigueira wants to merge 2 commits into
mainfrom
rfigueira/split-ci

Conversation

@ruifigueira

@ruifigueira ruifigueira commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The ci job ran these steps one after the other: the checks, the Rust lint, the Rust host tests, vitest, the dev build with its drift check, the formatter, oxlint and the workspace checks. A failed step stopped all the steps after it, so you saw only the first error. A flaky test made you run all the steps again.

This change splits the job into four jobs, like the e2e, Playwright, Puppeteer and WPT jobs. The four jobs run in parallel, report their own checks and rerun on their own.

Behavior and API impact

None for the engine. Only CI changes.

The required check ci stays, so the ruleset on main does not change. The ci check is now the final job that collects the results.

Implementation

Job Steps
vouch The author trust gate. All other jobs wait for it, including e2e, playwright, puppeteer and wpt.
check bazel test //:check. On main, this job saves the Bazel repository cache.
unit bazel test //packages/core:host_tests //packages/engine:vitest
lint pnpm install, format:check, lint:js, workspace_checks, bazel test //:rust_lint
build pnpm install, pnpm run build, the generated-drift check
ci Fails unless vouch and the four work jobs succeeded.
  • One compile on bazelflare: the jobs share the bazelflare action cache. If two jobs ask for the same action at the same time, bazelflare joins the second request to the running operation (enqueue in bazelflare's worker/src/do/scheduler.ts). Thus the Rust crates compile once.
  • The ci job: a required check counts a skipped job as passing. If the vouch gate fails, GitHub skips the work jobs. The ci job counts a skipped job as a failure, so the check still fails.
  • The test jobs wait for vouch too: before this change, e2e, playwright, puppeteer and wpt did not wait for the gate. On an unvouched pull request from a fork, they ran no tests but showed a green check. They now show as skipped until a maintainer approves the run. The ruleset does not require them, so ci does not wait for them.
  • pnpm install only where it is necessary: the type-aware rules of lint:js read types from node_modules. The Bazel targets ignore node_modules (REPO.bazel), so check and unit do not install.
  • One cache entry: all jobs restore one repository cache entry of 1.9 GB. One entry per job uses about 7.6 GB of the 10 GB quota. Thus only check saves the entry. On a cache miss on main, check first fetches the repositories of the other jobs with bazel build --nobuild.

Validation

  • actionlint .github/workflows/ci.yml: no errors.
  • pnpm run format:check: passes.
  • bazel run //scripts:lint -- lint:js without node_modules: exit 1, with 2 false explicit-boundary-returns errors. After pnpm install --frozen-lockfile: exit 0. This result is why lint keeps the install.
  • bazel run //scripts:lint -- format --check and bazel run //scripts:workspace_checks without node_modules: both pass.
  • bazel build --nobuild on the targets of the other jobs: passes locally in about 80 s.
  • pnpm run check and pnpm run test:e2e: not run. This change edits only the workflow.

The CI run of this pull request is the real test of the new jobs. The cache save step runs only on main, so this pull request cannot test it.

Risks and follow-ups

  • Fork pull requests compile more. A fork gets no OIDC token, so its jobs build on the runner. Each of check, unit and lint then compiles the Rust crates that it needs. This uses more runner minutes, but the time until all jobs finish does not increase. 7 of the last 100 pull requests came from forks.
  • The vouch gate adds a short delay. All jobs start after the vouch job finishes, which takes about 8 seconds. The wpt job is the longest at about 9 minutes, so the full run takes about 10 to 20 seconds longer.

Checklist

  • This pull request solves one problem; see CONTRIBUTING.md.
  • Every commit has a Signed-off-by line (git commit -s); see CONTRIBUTING.md.
  • Added or updated focused tests for behavior changes. (Not applicable: CI only.)
  • Updated documentation and generated files, or confirmed they do not apply.

beep-boop-🤖

The ci job ran the checks, the Rust lint, the Rust host tests, vitest,
the dev build with its drift check, the formatter, oxlint and the
workspace checks in sequence. A failure in one step hid the result of
every later step, and a flaky test meant rerunning all of them.

Each group is now its own job, like the e2e, Playwright, Puppeteer and
WPT lanes, so they run in parallel, report their own check and rerun on
their own. On bazelflare they share actions, so the Rust crates still
compile once. A fork's pull request builds on the runner, so there each
job compiles the crates it needs.

The vouch gate moves to its own job that the four jobs need. The main
ruleset requires a check named ci, and a required check counts a skipped
job as passing, so ci is now a job that fails unless vouch and the four
jobs all succeeded.

The lint and build jobs keep pnpm install: oxlint's type-aware rules
read types from node_modules and report false errors without them. The
Bazel targets ignore node_modules (REPO.bazel), so check and unit skip
the install.

Every job restores one repository cache entry and only check saves it,
so on a cache miss check also fetches the other jobs' repositories with
bazel build --nobuild before it saves.

beep-boop-🤖

Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
@github-actions github-actions Bot added the vouch:trusted Author is vouched, a collaborator, or a bot. label Nov 28, 2026
These jobs did not wait for the vouch gate. On an unvouched pull request
they still started and showed a green check, though they ran no tests:
the pull request comes from a fork, which gets no OIDC token, so they
skip every step that needs bazelflare.

Make them wait for the vouch job like the other jobs. Their checks then
show as skipped, not as passed, until a maintainer approves the run. The
gate also keeps unvouched code off bazelflare if forks ever get a token.

The ruleset does not require these checks, so the ci job does not wait
for them. The vouch job takes about 8 seconds, which the WPT job, the
longest at about 9 minutes, now waits for.

beep-boop-🤖

Signed-off-by: Rui Figueira <rfigueira@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted Author is vouched, a collaborator, or a bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant