From 432aba6af0c7c01ad35fecb76fd1ad2ff1dd7265 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:59:29 +0800 Subject: [PATCH] Only use sccache for non-cross targets --- .github/workflows/ci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6d5697ee..8e01f197 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,8 +51,10 @@ jobs: needs: get-msrv env: # use sccache - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" + # It's too much of a hassle to set up sccache in cross. + # See https://github.com/cross-rs/cross/wiki/Recipes#sccache. + SCCACHE_GHA_ENABLED: ${{ matrix.cargo == 'cargo' && 'true' || 'false'}} + RUSTC_WRAPPER: ${{ matrix.cargo == 'cargo' && 'sccache' || '' }} # Emit backtraces on panics. RUST_BACKTRACE: 1 runs-on: ${{ matrix.os }} @@ -119,6 +121,9 @@ jobs: components: clippy - name: Set up sccache + # It's too much of a hassle to set up sccache in cross. + # See https://github.com/cross-rs/cross/wiki/Recipes#sccache. + if: matrix.cargo == 'cargo' uses: mozilla-actions/sccache-action@v0.0.4 - name: Install cross