Limit Depot cache writes on pull requests #3001
[P2] Share Rust cache keys across each split job pair
The pinned Rust cache actions include the job ID in both their primary and fallback restore keys by default. Main now saves under cargo-test-linux-trusted, while PRs restore under cargo-test-linux, so PRs cannot consume the newly warmed caches. With PR saves disabled, their caches become stale or disappear. The same mismatch affects both benchmark pairs and the publish pair. Give each pair a stable explicit cache key and disable add-job-id-key (or use shared-key for the direct Swatinem action), keeping unrelated jobs distinct.
# N.B. despite setting this, Depot jobs allow cache writes directly through the API
cache-mode: read
[P3] Retain a trusted cache writer for uv-dev benchmarks
Both benchmark jobs exclude astral-sh/uv-dev on main, and plan.yml only schedules benchmarks for labeled PRs there. This guard therefore leaves uv-dev's benchmark caches without a writer. Once existing entries expire, repeated benchmark runs cannot reuse cached Rust builds; importing CodSpeed profiles from uv does not populate these repository-local caches. Consider retaining a trusted main-branch build/cache-warming path while keeping benchmark measurements disabled there. The same issue applies to the simulated benchmark job.
Promoted to #23079.
zanieb
zaniebot
Depot runners share an Actions cache across branches of the same repository. Use
save-ifon the Depot Linux tests and benchmarks so the action restores the Rust cache on pull requests and saves it only onmain.Pull request review jobs use
cache-mode: read. Depot jobs can still obtain an upload URL directly from the cache API.