From f80cf9f791a3c0e9a68a48a6f2395fc693d27929 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Wed, 11 Dec 2024 21:12:24 +1100 Subject: [PATCH] chore(ci): add rust caching Signed-off-by: JP-Ellis --- .github/workflows/build-ffi.yml | 4 ++++ .github/workflows/build.yml | 4 ++++ .github/workflows/compatability-suite.yml | 6 ++++++ .github/workflows/release.yml | 4 ++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ffi.yml b/.github/workflows/build-ffi.yml index 2e9d5720..042c5bc2 100644 --- a/.github/workflows/build-ffi.yml +++ b/.github/workflows/build-ffi.yml @@ -34,6 +34,10 @@ jobs: with: toolchain: stable components: rustfmt + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + shared-key: ${{ runner.os }} - name: Install shared mime info DB if: runner.os == 'macOS' run: brew install shared-mime-info diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0f54038..68cafa64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,10 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: cargo-nextest + - uses: Swatinem/rust-cache@v2 + with: + workspaces: rust + shared-key: ${{ runner.os }}-musl - name: Tests run: cargo nextest run working-directory: rust diff --git a/.github/workflows/compatability-suite.yml b/.github/workflows/compatability-suite.yml index eb4d6aa5..175d7ef2 100644 --- a/.github/workflows/compatability-suite.yml +++ b/.github/workflows/compatability-suite.yml @@ -31,6 +31,12 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: cargo-nextest + - uses: Swatinem/rust-cache@v2 + with: + workspaces: | + rust + compatibility-suite + shared-key: ${{ runner.os }} - name: Run Cucumber # Note: cucumber's test executables are incompatible with nextest # See: https://github.com/nextest-rs/nextest/issues/1329 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fa809da..fee21da6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,10 +62,10 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: rust - key: ${{ matrix.targets }} + shared-key: ${{ runner.os }} - name: Set up QEMU - if: runner.os == 'Linux' + if: runner.os == 'Linux' && startsWith(matrix.targets, 'aarch64') uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx