From 27447d21a7dfeac53fde6ce7942b5daeba96d7ca Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Sun, 29 Nov 2026 22:07:17 +0800 Subject: [PATCH] ci: keep the Windows Rust cache warm and allow a cold build 75 minutes (#6850) A Windows run on main that ended in a test failure skipped the Rust cache save, so the next PR compiled every dependency again (about 19 minutes of Clippy plus 30 of test binaries) and ran out of the 60-minute limit partway through the tests. - rust-cache in the Rust job saves on failure too; still only on main, PRs and forks restore. - The Windows Rust job gets 75 minutes; macOS and Linux stay at 60. Refs #6496 --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0e8649af5..246d642d88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,7 +106,8 @@ jobs: if: needs.changes.outputs.rust == 'true' permissions: contents: read - timeout-minutes: 60 + # A Windows build that misses the Rust cache spends ~50 minutes compiling before the tests run. + timeout-minutes: ${{ matrix.os == 'windows-latest' && 75 || 60 }} strategy: fail-fast: false matrix: @@ -127,10 +128,12 @@ jobs: with: { components: "clippy, rustfmt" } # Self-hosted runners keep persistent local Cargo caches; GitHub-hosted runners use Actions cache # (only main saves it because saving takes minutes on Windows; PRs restore main's). + # A failing test run on main still saves it, so the next PR doesn't compile from scratch. - uses: Swatinem/rust-cache@v2 if: runner.environment != 'self-hosted' with: save-if: ${{ github.ref == 'refs/heads/main' }} + cache-on-failure: true # The persistent target dir makes incremental builds pay off; cap its size so it can't fill the disk. - name: Persistent Cargo target dir if: runner.environment == 'self-hosted'