From fb3b586dd047663a100ecec4cbc48a9018c39bb7 Mon Sep 17 00:00:00 2001 From: Anton Baliasnikov Date: Wed, 27 Nov 2024 13:23:57 +0000 Subject: [PATCH] fix: use cargo cache in unit tests action (#49) --- .github/actions/cargo-check/action.yml | 3 +-- .github/actions/rust-unit-tests/action.yml | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/cargo-check/action.yml b/.github/actions/cargo-check/action.yml index 8bf4bf2..28ea5c7 100644 --- a/.github/actions/cargo-check/action.yml +++ b/.github/actions/cargo-check/action.yml @@ -17,10 +17,9 @@ runs: - name: Rust cache uses: Swatinem/rust-cache@v2 with: - shared-key: "rust-cargo-cache" + shared-key: "rust-cargo-cache-${{ runner.os }}-${{ runner.arch }}" save-if: ${{ github.ref == 'refs/heads/main' }} - - name: Cargo deny uses: EmbarkStudios/cargo-deny-action@v2 with: diff --git a/.github/actions/rust-unit-tests/action.yml b/.github/actions/rust-unit-tests/action.yml index bfb441a..c938268 100644 --- a/.github/actions/rust-unit-tests/action.yml +++ b/.github/actions/rust-unit-tests/action.yml @@ -33,6 +33,12 @@ runs: rustup target add ${{ inputs.target }} echo "target=--target ${{ inputs.target }}" >> "${GITHUB_OUTPUT}" + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + shared-key: "rust-cargo-cache-${{ runner.os }}-${{ runner.arch }}" + save-if: ${{ github.ref == 'refs/heads/main' }} + - name: Prepare test env shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} run: |