From 7ec0ee6cfc6cc67858e9fcdeeebb78cfc1e826aa Mon Sep 17 00:00:00 2001 From: Nick Carton Date: Sat, 30 Nov 2024 18:07:06 +0100 Subject: [PATCH] Add rust cache --- .github/workflows/release.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eaffe06..b8a80ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ on: pull_request: push: tags: - - '**[0-9]+.[0-9]+.[0-9]+*' + - "**[0-9]+.[0-9]+.[0-9]+*" jobs: # Run 'dist plan' (or host) to determine what tasks we need to do @@ -129,6 +129,27 @@ jobs: - name: Install dependencies run: | ${{ matrix.packages_install }} + + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.6 + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + prefix-key: "v1-rust" + shared-key: "${{ matrix.target }}-build" + cache-targets: "true" + cache-on-failure: "true" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/master' }} + workspaces: | + . -> target + - name: Build artifacts run: | # Actually do builds and make zips and whatnot @@ -147,6 +168,7 @@ jobs: echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" + - name: "Upload artifacts" uses: actions/upload-artifact@v4 with: