diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9f423b07..335db6ae 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -40,6 +40,12 @@ jobs: - name: Setup image (Linux) run: ./.github/scripts/provision-linux-build.sh + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-checks @@ -62,6 +68,12 @@ jobs: - name: Setup image (Linux) run: ./.github/scripts/provision-linux-build.sh + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-checks @@ -84,6 +96,12 @@ jobs: - name: Setup image (Linux) run: ./.github/scripts/provision-linux-build.sh + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-checks @@ -132,6 +150,12 @@ jobs: - name: Setup image (Linux) run: ./.github/scripts/provision-linux-build.sh + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-checks @@ -168,6 +192,12 @@ jobs: - name: Setup image (Linux) run: ./.github/scripts/provision-linux-build.sh + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-checks diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aec1f747..0d8c2d9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,6 +94,12 @@ jobs: if: ${{ contains(matrix.os, 'ubuntu') }} run: ./.github/scripts/provision-linux-build.sh + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-test @@ -131,6 +137,12 @@ jobs: "$env:USERPROFILE\.cargo", ` "$env:USERPROFILE\.rustup" -ErrorAction SilentlyContinue + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-test diff --git a/.github/workflows/validate-examples.yml b/.github/workflows/validate-examples.yml index 8e5b6595..13dcb353 100644 --- a/.github/workflows/validate-examples.yml +++ b/.github/workflows/validate-examples.yml @@ -52,6 +52,12 @@ jobs: if: ${{ contains(matrix.os, 'ubuntu') }} run: ./.github/scripts/provision-linux-build.sh + # rust-cache hashes all installed toolchains; the runner image's `stable` + # drifts as the image updates, which moves the cache key and causes misses. + # Remove it so only the rust-toolchain.toml-pinned version remains. + - name: Remove the runner's bundled Rust toolchain + run: rustup toolchain remove stable 2>/dev/null || true + - uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4 with: cache-shared-key: ${{ runner.os }}-validate