From 79276e0e9a8b4f91ea2727b8b88264b22054ee98 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:10:55 +0800 Subject: [PATCH 1/3] CI: use sccache to speed up CI --- .github/workflows/ci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 11027ba8..6d5697ee 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,6 +50,9 @@ jobs: name: Test on each target needs: get-msrv env: + # use sccache + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" # Emit backtraces on panics. RUST_BACKTRACE: 1 runs-on: ${{ matrix.os }} @@ -114,6 +117,9 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} components: clippy + + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.4 - name: Install cross if: matrix.cargo == 'cross' From b78dd268eabf8fdd0c9842d8e19bcc2d8bac39eb Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:12:20 +0800 Subject: [PATCH 2/3] Write changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc98dfdf..5560e2a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) * CI: add builds for target `aarch64-linux-android` #384 - @flxo * CI: Keep GitHub Actions up to date with GitHub's Dependabot #403 - @cclauss * CI: Enable more cross-compiled builds #401 - @cyqsimon +* CI: use sccache to speed up CI #408 - @cyqsimon ## Changed 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 3/3] 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