summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcyqsimon <28627918+cyqsimon@users.noreply.github.com>2024-04-16 19:49:53 +0800
committerGitHub <noreply@github.com>2024-04-16 19:49:53 +0800
commit13ef09aefdd653c19b439a0a12fa1924498f01b8 (patch)
tree5adb6f8df4d12a022f6d25459f6082504ec1b669
parent6a67ed03e9540d8443c20fc33e3f0119c89f20a3 (diff)
CI: use sccache to speed up CI (#408)
* CI: use sccache to speed up CI * Write changelog * Only use sccache for non-cross targets
-rw-r--r--.github/workflows/ci.yaml11
-rw-r--r--CHANGELOG.md1
2 files changed, 12 insertions, 0 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 11027ba..8e01f19 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -50,6 +50,11 @@ jobs:
name: Test on each target
needs: get-msrv
env:
+ # use 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 }}
@@ -114,6 +119,12 @@ jobs:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
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
if: matrix.cargo == 'cross'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bc98dfd..5560e2a 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