Skip to content

CI: cache Rust dependencies, run the Rust suites with cargo-nextest, and split macOS public-product in two - #135

Open
agorischek wants to merge 2 commits into
agorischek/ci-rules-lockfilesfrom
agorischek/ci-rust-speed
Open

agorischek wants to merge 2 commits into
agorischek/ci-rules-lockfilesfrom
agorischek/ci-rust-speed

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

Stacked on #134. This is step (d), the two speed-ups.

  • Rust build cache. .github/actions/check now uses Swatinem/rust-cache@v2.9.3 (locked in actions.lock).
    • It caches the dependencies' build output, not the workspace's own crates.
    • The key includes the toolchain, Cargo.lock and the job's part.
    • Only pushes to main save the cache (save-if); pull requests restore main's.
    • Today public-product (macos-latest) compiles all 909 crates from scratch.
  • cargo-nextest. CI runs npm run test:rust:nextest: nextest across the workspace, then doctests, then the rules coverage, rustfmt and Clippy that npm run test:rust also runs. Locally, npm run test:rust is unchanged.
    • .config/nextest.toml puts the three .NET native suites in a one-at-a-time group. They publish a shared helper "once per run" with a Once, which under nextest's process-per-test means once per test, into one directory.
  • No double CLI Rust run. Before, Linux public-product ran cargo test -p projections-cli inside npm test, then again in npm run test:rust. Now npm run check is check:no-test && npm test, and the action runs the Node suites without packages/cli's script, then the CLI's Node tests directly. problems.test.ts follows the split.
  • macOS split. The check action takes part: all | rust | node.
    • public-product's matrix entries in .github/ci-rules.json gain name and with (the schema changes from value). The workflow uses matrix.include and name: public-product (${{ matrix.name }}).
    • Linux stays one job, public-product (ubuntu-latest), with the same check name.
    • macOS becomes public-product (macos-latest, Rust) (build, then nextest and the Rust checks) and public-product (macos-latest, Node) (static checks, build, types, lint, Node suites, installed-CLI proofs, action e2e, tools doctor), running in parallel.
    • Branch protection should require only ci-ok, so the renamed macOS checks don't matter there.
  • Docs: CONTRIBUTING.md and docs/maintainers/runner-coverage.md.

This PR changes package.json, .config/ and CI files, so it runs everything, including both macOS parts. Its run is the measurement against the about 53 minutes of today's macOS job. The first runs restore no cache until a push to main saves one.

@agorischek
agorischek requested a balanced review from Copilot November 21, 2026 04:11
@agorischek
agorischek force-pushed the agorischek/ci-rules-lockfiles branch from 972cbb2 to dc0b37f Compare November 21, 2026 04:21
@agorischek
agorischek force-pushed the agorischek/ci-rust-speed branch from 7590917 to 97882ca Compare November 21, 2026 04:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Planner tests do not verify the new matrix include objects or their workflow-output serialization, leaving missing fields or incorrectly included jobs undetected.

1 open issue
What changed in this PR

This PR speeds up CI by caching Rust dependency builds, adopting cargo-nextest, and splitting macOS checks into parallel Rust and Node jobs. It extends the existing CI planner to supply named matrix entries while preserving the Linux check name.

Changes:

  • Add Rust caching and nextest execution, including serialized .NET helper tests.
  • Separate Rust and Node checks to avoid duplicate CLI Rust tests.
  • Update matrix planning, schemas, test expectations, and contributor documentation.
File Description
tools/​scripts/​ci-plan.mjs Serialize matrix include objects for workflow outputs.
tools/​cli/​test/​problems.test.ts Expand the split check script when verifying gate coverage.
tools/​cli/​test/​ci-plan.cases.json Update expected macOS job names.
tools/​cli/​src/​lib/​ci-rules.schema.ts Define named matrix entries with input values.
tools/​cli/​src/​lib/​ci-plan.ts Produce matrix include objects alongside job names.
package.json Add nextest and separate shared checks from tests.
docs/​maintainers/​runner-coverage.md Document parallel macOS coverage.
CONTRIBUTING.md Describe nextest, caching, and the macOS split.
.github/​workflows/​ci.yml Run named matrix entries and route checks by part.
.github/​workflows/​actions.lock Lock the Rust cache action dependency.
.github/​ci-rules.schema.json Reflect the updated matrix schema.
.github/​ci-rules.json Define Linux and split macOS matrix entries.
.github/​actions/​check/​action.yml Configure caching, nextest, and partitioned checks.
.config/​nextest.toml Serialize tests that share the .NET helper output.

Review effort: Balanced

Comment thread tools/cli/src/lib/ci-plan.ts Resolved
agorischek and others added 2 commits November 20, 2026 20:32
…and split macOS public-product in two

- .github/actions/check restores the dependencies' build output with
  Swatinem/rust-cache (keyed on the toolchain, Cargo.lock and the job's part;
  only pushes to main save it), and runs the Rust suites with cargo-nextest:
  `npm run test:rust:nextest` (nextest across the workspace, doctests, then the
  same rules coverage, rustfmt and Clippy as `npm run test:rust`).
  .config/nextest.toml keeps the .NET suites, which publish one shared helper,
  one at a time.
- The CLI's Rust suites no longer run twice: `npm run check` is now
  `check:no-test` and `npm test`, and the action runs the Node suites without
  packages/cli's test script, whose Rust half the workspace run covers.
- The action takes a `part`: all, rust or node. public-product's matrix entries
  in .github/ci-rules.json now carry `with` values for the workflow's
  matrix.include, and macOS runs as `macos-latest, Rust` and
  `macos-latest, Node` in parallel; Linux stays one job, `ubuntu-latest`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…nclude objects included

Copilot review on #135.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@agorischek
agorischek force-pushed the agorischek/ci-rust-speed branch from 97882ca to 33c3585 Compare November 21, 2026 04:33

This branch has not been deployed

No deployments
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.

2 participants