Skip to content

ci: Split checks into parallel jobs and stop recompiling GPUI per step - #3068

Merged
huacnlee merged 4 commits into
mainfrom
ci-parallel-jobs
Sep 14, 2026
Merged

huacnlee merged 4 commits into
mainfrom
ci-parallel-jobs

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 14, 2026

Copy link
Copy Markdown
Member

Summary

The macOS Test job took ~30 minutes because it ran every check in series and compiled GPUI five times over: each step used a different feature set, the Cargo cache was restored only after the first two test runs, and typos/machete were built from source with cargo install.

Parallel layout, one feature set per job

  • checks (ubuntu, no Rust compile): typos via crate-ci/typos and machete via taiki-e/install-action, both prebuilt binaries; skill-guide diff; check-ai docs.
  • lint (macOS) and recipes (ubuntu) run as their own parallel jobs. The recipes crate is a deliberately isolated workspace and always needs its own build, so it no longer sits on the macOS critical path.
  • test matrix keeps one feature set per platform. cargo tree -e features confirms the workspace run already enables gpui-kit/test-support, so the separate "Headless UI integration tests" step was a duplicate on all three platforms. Doc tests and the Metal rendering test now use the same --workspace --features gpui-component-story/test-support invocation (--doc / --test rendering) and reuse the build.
  • gpui-shell-core doc tests use --release to share the release build.
  • script/check-ai-recipes: drop cargo check --all-targets; the cargo test that follows builds the same targets. cargo check --bin stays because it proves the recipes compile before dev-dependencies unify test-support in.

Caches that actually survive

The first run of the new layout was still cold in every job: the repository holds 11.7 GB of Actions caches against the 10 GB limit, so entries were evicted before the next run could restore them. Each entry was 1–2 GB, most of it debug info.

  • CARGO_PROFILE_DEV_DEBUG=0 for all CI builds — smaller caches, faster linking; nothing in CI reads debug info.
  • Caches are saved only from main (cache-save-if); PRs restore the closest main entry through rust-cache's prefix fallback instead of adding their own.
  • Drop the hand-rolled actions/cache steps that cached the whole target/ on top of the rust-cache that setup-rust-toolchain already installs.
  • The two Linux release builds of gpui-shell share one cache key.
  • Linux runners link with mold (rui314/setup-mold, no-op elsewhere).

Because the cache key includes the CARGO_PROFILE_* environment, this PR's own runs stay cold; the first main run after merge populates the caches and later PRs restore them.

Doc-test fixes

Running doc tests workspace-wide surfaced two broken doc examples, fixed here: gpui-fps was missing prelude::*, and gpui-kit-assets referenced gpui_platform without depending on it (cargo test --doc ignores [lib] doctest = false, so it is removed and gpui_platform added as a dev-dependency).

Verified locally: workspace cargo test --doc passes for every crate, --workspace --test rendering selects and passes the 2 Metal cases, typos, cargo machete, cargo fmt --check, clippy on the touched crates, check-ai docs, and the recipes lock file stays consistent under --locked.

🤖 Generated with Claude Code

https://claude.ai/code/session_019RrFLRLnLWUuUNPyDXSJZU

huacnlee and others added 3 commits September 14, 2026 21:10
The macOS Test job ran every check in series and compiled GPUI five
times over: each step used a different feature set, the Cargo cache was
restored only after the first two test runs, and typos/machete were
built from source with `cargo install`.

- Move typos, machete, the skill-guide diff and the recipe-fragment
  check to a `checks` job on ubuntu that compiles no Rust; both tools
  now come as prebuilt binaries.
- Run clippy and the recipe verification as their own parallel jobs.
- Keep every test job on one feature set. The workspace run already
  enables `gpui-kit/test-support`, so the separate headless step was a
  duplicate; doc tests and the Metal rendering test now reuse the same
  build instead of rebuilding GPUI.
- Rely on the rust-cache that `setup-rust-toolchain` installs and drop
  the hand-rolled `actions/cache` steps that cached the whole `target/`.
- Drop the redundant `cargo check --all-targets` from
  `script/check-ai-recipes`; the `cargo test` that follows builds the
  same targets.
- Fix the `gpui-fps` and `gpui-kit-assets` doc examples so the whole
  workspace passes `cargo test --doc` (`--doc` ignores `doctest = false`).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZuwHtZTbfSFBmCBP6wVwf
… Linux

The first run of the parallel layout was still cold everywhere: the
repository holds 11.7 GB of Actions caches against a 10 GB limit, so
rust-cache entries were evicted before the next run could restore them.
Each entry was 1-2 GB, most of it debug info nothing in CI reads.

- Build without debug info (`CARGO_PROFILE_DEV_DEBUG=0`), which shrinks
  every cache and shortens linking.
- Save caches only from `main`; pull requests restore the closest `main`
  entry through rust-cache's prefix fallback instead of adding their own.
- The two Linux release builds of `gpui-shell` share one cache key.
- Replace the system linker with mold on Linux runners.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019RrFLRLnLWUuUNPyDXSJZU
With a warm dependency cache, most of the Test job's build time went to
compiling and linking a test binary for each `examples/` crate, none of
which is worth one. The `lint` job now runs clippy over the whole
workspace, which type-checks every example, and the Test job excludes
the `examples/` members computed from `cargo metadata`. `cargo tree`
confirms this leaves every remaining crate's feature set unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019RrFLRLnLWUuUNPyDXSJZU
@huacnlee
huacnlee enabled auto-merge (squash) September 14, 2026 14:17
The Windows test job failed with `invalid character '\n' in package
name`: jq on Windows writes CRLF, so `tr '\n' ' '` left a `\r` glued
to every example crate name. `jq -j` emits the list as one line with
no newline at all, so there is nothing for Windows to translate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015h6NVoQ9eht4g3HDVBb8Yj
@huacnlee
huacnlee merged commit 1ea88f7 into main Sep 14, 2026
11 checks passed
@huacnlee
huacnlee deleted the ci-parallel-jobs branch September 14, 2026 15:29
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