Follow-up to #831 (test workflow speedup).
Context
PR #831 added sccache, which helps on warm runs. But cold builds (new PR, dependency bump, cache miss) still recompile ~400 crates from scratch. The Cargo.lock is ~8500 lines.
Proposal
Build a CI Docker image that contains a pre-compiled target/ directory with all dev-dependencies compiled (cargo test --no-run). Push to ghcr.io/nearai/cloud-api-ci:latest and refresh via a scheduled workflow (weekly) or on Cargo.lock changes. The runner pulls this image, swatinem/rust-cache hits the pre-warmed cache, and only local crate code is compiled from scratch.
Expected impact
60-80% reduction in compilation time for cache-hit runs. Tradeoff: increased CI complexity, multi-GB image storage, invalidation costs on Cargo.lock changes.
Alternative
Keep relying on sccache (persistent on the self-hosted runner) and only pursue this if cold-build times remain a problem after the dedicated CI VM lands.
Follow-up to #831 (test workflow speedup).
Context
PR #831 added sccache, which helps on warm runs. But cold builds (new PR, dependency bump, cache miss) still recompile ~400 crates from scratch. The
Cargo.lockis ~8500 lines.Proposal
Build a CI Docker image that contains a pre-compiled
target/directory with all dev-dependencies compiled (cargo test --no-run). Push toghcr.io/nearai/cloud-api-ci:latestand refresh via a scheduled workflow (weekly) or onCargo.lockchanges. The runner pulls this image,swatinem/rust-cachehits the pre-warmed cache, and only local crate code is compiled from scratch.Expected impact
60-80% reduction in compilation time for cache-hit runs. Tradeoff: increased CI complexity, multi-GB image storage, invalidation costs on
Cargo.lockchanges.Alternative
Keep relying on sccache (persistent on the self-hosted runner) and only pursue this if cold-build times remain a problem after the dedicated CI VM lands.