From a6e59de8f0bf063f5de9b6242c3fc7a0e190c2c4 Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Thu, 14 May 2026 15:08:28 -0400 Subject: [PATCH] ci: switch to Swatinem/rust-cache to fix macOS build (#90) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caching ~/.cargo/bin/ via actions/cache@v4 was poisoning the cargo shim on macOS runners — restored cargo resolved to rustup-init and failed with "unexpected argument 'build' found". Swatinem/rust-cache skips that directory and handles target/ pruning + key derivation. Co-authored-by: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 696ab14..84590db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,17 +20,7 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Cache cargo - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + uses: Swatinem/rust-cache@v2 - name: Run tests run: cargo test --verbose @@ -61,17 +51,9 @@ jobs: components: clippy - name: Cache cargo - uses: actions/cache@v4 + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-clippy- + key: clippy - name: Run clippy run: cargo clippy -- -D warnings @@ -89,17 +71,9 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Cache cargo - uses: actions/cache@v4 + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-build- + key: build - name: Build run: cargo build --release --verbose