From 42bffef98c47e2d8c44a8e1912584da96a129ce2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Mar 2023 15:42:42 +1100 Subject: [PATCH] Use sccache for build cache and disable incremental mode in CI (#914) Fixed #911 sccache cannot cache build artifacts if incremental mode is enabled. Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 078f46df..0d1405be 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -54,9 +54,15 @@ runs: shell: bash - if: inputs.buildcache - name: Configure build cache - uses: actions/cache@v3 + name: Configure sccache + uses: mozilla-actions/sccache-action@v0.0.2 with: - path: | - target/ - key: ${{ runner.os }}-cargo-build-${{ hashFiles('rustc-version') }}-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} + version: "v0.4.0-pre.10" + + - if: inputs.buildcache + name: Export env for sccache to work + shell: bash + run: | + echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV