From 53f74921a74bba1702dc71cc5db8ff82965fa1dd Mon Sep 17 00:00:00 2001 From: "Christian M. Todie" Date: Tue, 10 Nov 2026 18:33:27 -0500 Subject: [PATCH] ci(workflows): migrate Rust CI cache to kache --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++------------- .github/workflows/package.yml | 24 ++++++++---- .github/workflows/prewarm.yml | 15 ++++--- 3 files changed, 72 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3005fa4..d9f898c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,15 +94,19 @@ jobs: if: needs.changes.outputs.rust == 'true' runs-on: ubuntu-latest timeout-minutes: 15 - env: - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: clippy - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: ci-clippy + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: cargo clippy run: cargo clippy --workspace --all-targets -j 2 -- -D warnings @@ -112,13 +116,17 @@ jobs: if: needs.changes.outputs.rust == 'true' runs-on: ubuntu-latest timeout-minutes: 15 - env: - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: ci-check + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: cargo check run: cargo check --workspace --all-targets -j 2 @@ -128,13 +136,17 @@ jobs: if: needs.changes.outputs.rust == 'true' runs-on: ubuntu-latest timeout-minutes: 15 - env: - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: ci-test + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: cargo test run: cargo test --workspace -j 2 @@ -144,13 +156,17 @@ jobs: if: needs.changes.outputs.rust == 'true' runs-on: ubuntu-latest timeout-minutes: 10 - env: - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: ci-smoke + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: smoke test run: make smoke @@ -173,15 +189,19 @@ jobs: if: needs.changes.outputs.rust == 'true' runs-on: ubuntu-latest timeout-minutes: 20 - env: - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: ci-xwork + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: cargo xtask xwork run: cargo xtask xwork @@ -201,13 +221,13 @@ jobs: run: | rustup toolchain install rustc --version - - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 with: - shared-key: xtask-ci - # The tool pins live in gates.rs, so a pin change must miss the cache. - key: ${{ hashFiles('crates/xtask/src/gates.rs') }} - # The pinned tools `cargo xtask tools` builds into .tools/. - cache-directories: .tools - cache-on-failure: true + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: xtask-ci + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: cargo xtask ci run: cargo xtask ci diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 96d8d82..db3171d 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -63,16 +63,20 @@ jobs: if: github.event_name == 'pull_request' runs-on: ubuntu-latest timeout-minutes: 10 - env: - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" permissions: contents: read pull-requests: read steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: package-signed-commits + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: cargo xtask verify-signed env: GH_TOKEN: ${{ github.token }} @@ -84,9 +88,6 @@ jobs: if: needs.changes.outputs.image == 'true' runs-on: ubuntu-latest timeout-minutes: 30 - env: - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" permissions: contents: read packages: write @@ -96,7 +97,14 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-unknown-linux-musl - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: package-image + save-cache: ${{ github.ref == 'refs/heads/main' }} - name: cargo xtask package run: cargo xtask package - uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/prewarm.yml b/.github/workflows/prewarm.yml index cc92984..f08a675 100644 --- a/.github/workflows/prewarm.yml +++ b/.github/workflows/prewarm.yml @@ -1,6 +1,6 @@ name: Prewarm -# Fill the sccache store from main so pull requests start from warm compiles. +# Fill the kache store from main so pull requests start from warm compiles. # Caches written on main are readable by every PR branch; caches written on a PR branch # are not. GitHub evicts caches unused for 7 days, so a schedule keeps the store warm. @@ -28,8 +28,6 @@ env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: "0" CARGO_NET_RETRY: "10" - RUSTC_WRAPPER: sccache - SCCACHE_GHA_ENABLED: "true" jobs: prewarm: @@ -42,7 +40,14 @@ jobs: with: components: clippy targets: x86_64-unknown-linux-musl - - uses: mozilla-actions/sccache-action@v0.0.9 + - name: Rust build cache (kache) + uses: kunobi-ninja/kache-action@ad7317540dcdd71c904f7a60a87b620a0c0e67ed # v2.0.0 + with: + version: "2.0.0" + cache-executables: "false" + github-cache: "true" + manifest-key: prewarm + save-cache: ${{ github.ref == 'refs/heads/main' }} # Same cargo invocations as ci.yml and package.yml, so the cache keys match. - name: check run: cargo check --workspace --all-targets -j 2 @@ -52,5 +57,3 @@ jobs: run: cargo test --workspace --no-run -j 2 - name: musl release build run: cargo build --release -j 2 -p lsc --target x86_64-unknown-linux-musl - - name: sccache stats - run: sccache --show-stats