Skip to content

Cache CI dependencies by suite and installed Rust toolchains - #2186

Open
dblock wants to merge 2 commits into
trailofbits:masterfrom
dblock:dblock/ci-dependency-cache
Open

dblock wants to merge 2 commits into
trailofbits:masterfrom
dblock:dblock/ci-dependency-cache

Conversation

@dblock

@dblock dblock commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Adds a dependency-only Rust build cache, keyed by test suite, OS/architecture, installed compiler versions/hashes, and Cargo configuration/dependencies. Workspace crates are rebuilt, and temporary test workspaces remain isolated. Installed tools keep using the existing cache.

Depends on #2185. This branch is based on its head; both PRs target master because the prerequisite branch is in a fork. GitHub native stack registration is unsupported for fork heads. Cache-only diff.

Timings

All three runs completed successfully with the same ten test suites: #2185 baseline, cold dependency cache, and warm dependency cache.

Metric #2185 Cold Warm
Workflow elapsed 70m37s 71m59s 68m48s
Summed job elapsed 337m46s 357m31s 252m17s
Summed Test steps 263m42s 281m50s 189m53s
Dependency cache restore steps - 18s 4m03s
Dependency cache save steps - 8m20s 3s

Warm versus #2185: 85m29s less summed job elapsed (25.3%), but only 1m49s less workflow elapsed (2.6%). Warm versus cold: 105m14s less summed job elapsed (29.4%) and 3m11s less workflow elapsed (4.4%). The Windows CLI suite remains the critical path at 68m09s overall; temporary test builds intentionally remain uncached.

Cold and warm used identical Git trees. Upstream reruns were denied for this read-only account, so the warm run was triggered by an identical-tree commit on the fork branch. All ten warm job logs confirm exact hits (Cache up-to-date.); workspace crates still compile and tests still execute. The ten compressed caches total 9.28 GB (8.64 GiB); full/scheduled matrices may add entries, and storage-limit evictions can reduce reuse.

Workflow elapsed is attempt start through the last job's completion. Summed job elapsed includes planning, setup, tests, and cache post-actions; it is not OS-weighted billing. These are single observations, not controlled causal benchmarks: runner load, setup durations, and existing non-dependency cache state also vary.

Validation

actionlint, Prettier, Rust formatting, planner/ShellCheck tests (3 passed), and strict workspace custom lints passed locally. Both hosted runs passed all ten suites, planning, the final gate, and CLA checks.

Authored by an AI acting on behalf of @dblock.

dblock and others added 2 commits November 19, 2026 10:06
Plan explicit matrix entries from the PR or merge-group base commit before allocating test runners. Preserve regular platform coverage and full expensive suites on relevant changes, schedules, and manual runs. Fail the required gate if planning fails.

Install formatting, CI, and scheduled-check tools only for suites that use them. Consolidate Rustup updates while retaining common toolchain preinstallation and disk cleanup. Test event selection, deleted and renamed paths, and invalid bases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the dblock/ci-dependency-cache branch from c731be2 to 7792cb7 Compare November 19, 2026 15:09

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.

1 participant