@@ -322,15 +322,6 @@ jobs:
322322 - name : Pull LFS files
323323 run : git lfs pull
324324
325- # See the test job for why this exists: pin submodule source mtimes to a
326- # fixed timestamp so cargo treats the workspace as unchanged across runs
327- # and reuses the cached FFI build instead of recompiling it (~6 min).
328- # Runs before the cargo target cache is restored, so target/ is untouched.
329- - name : Stabilize Rust source mtimes for cargo freshness
330- shell : bash
331- run : |
332- find client-sdk-rust -type f -not -path '*/.git/*' -exec touch -t 202001010000 {} +
333-
334325 # Reclaim ~30GB on the runner. The debug+coverage object tree plus gcov
335326 # data is large; prior runs died mid-build from disk/memory pressure.
336327 - name : Free disk space
@@ -369,14 +360,9 @@ jobs:
369360 toolchain : stable
370361
371362 # ---------- Cache Cargo ----------
372- # Key the target cache on the client-sdk-rust submodule SHA (see builds.yml
373- # rationale). Restore/save split so the populated target/ is captured right
374- # after the build.
375- - name : Resolve Rust submodule SHA
376- id : rust_sha
377- shell : bash
378- run : echo "sha=$(git -C client-sdk-rust rev-parse HEAD)" >> "$GITHUB_OUTPUT"
379-
363+ # Only the cargo registry (downloaded crate sources, ~60 MB) is cached
364+ # here. The compiled target/ is intentionally not cached for coverage —
365+ # see the note below the registry cache step.
380366 - name : Cache cargo registry
381367 uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
382368 with :
@@ -388,14 +374,14 @@ jobs:
388374 restore-keys : |
389375 ${{ runner.os }}-coverage-cargo-registry-
390376
391- - name : Restore cargo target
392- id : cache-cargo- target
393- uses : actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
394- with :
395- path : client-sdk-rust/target/
396- key : ${{ runner.os }}-coverage-cargo-target-${{ steps.rust_sha.outputs.sha }}
397- restore-keys : |
398- ${{ runner.os }}-coverage-cargo-target-
377+ # NOTE: we deliberately do NOT cache client-sdk-rust/ target/ here. The
378+ # coverage job builds the FFI in debug mode, so its target/ was ~2.8 GB —
379+ # the single largest entry in the repo's 10 GB Actions cache budget. That
380+ # one cache crowded out the release build/test caches (and the Windows
381+ # vcpkg binaries), causing repo-wide LRU eviction and cold rebuilds
382+ # elsewhere. Coverage runs once per PR off the critical path, so eating a
383+ # cold FFI build here is cheaper than the eviction it caused. The cargo
384+ # registry cache above is tiny (~60 MB) and stays.
399385
400386 # ---------- Build environment setup ----------
401387 - name : Set build environment
@@ -422,14 +408,6 @@ jobs:
422408 - name : Build
423409 run : cmake --build build-debug --parallel 2
424410
425- # Snapshot the populated target/ after the build succeeds, only on a miss.
426- - name : Save cargo target
427- if : steps.cache-cargo-target.outputs.cache-hit != 'true'
428- uses : actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
429- with :
430- path : client-sdk-rust/target/
431- key : ${{ runner.os }}-coverage-cargo-target-${{ steps.rust_sha.outputs.sha }}
432-
433411 # ---------- Run unit tests ----------
434412 - name : Run unit tests
435413 timeout-minutes : 5
0 commit comments