From d4a540857d02a819b844926096bf1f81246c516b Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 12 Oct 2024 18:41:42 -0600 Subject: [PATCH] ci: Add Rust workspace cache --- .github/workflows/build.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fb12856..06b716f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,6 +30,8 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: clippy + - name: Cache Rust workspace + uses: Swatinem/rust-cache@v2 - name: Cargo check run: cargo check --all-features --all-targets - name: Cargo clippy @@ -85,6 +87,8 @@ jobs: uses: actions/checkout@v4 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable + - name: Cache Rust workspace + uses: Swatinem/rust-cache@v2 - name: Cargo test run: cargo test --release --all-features @@ -151,6 +155,10 @@ jobs: uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} + - name: Cache Rust workspace + uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} - name: Cargo build run: > cargo ${{ matrix.build }} --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }} @@ -202,6 +210,10 @@ jobs: uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} + - name: Cache Rust workspace + uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} - name: Cargo build run: > cargo build --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }}