Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit cb70c5f

Browse files
committed
ci: switch to sccache for Rust compilation cache
1 parent b9258f7 commit cb70c5f

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ concurrency:
2121
env:
2222
CARGO_TERM_COLOR: always
2323
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
24+
SCCACHE_GHA_ENABLED: "true"
25+
RUSTC_WRAPPER: "sccache"
2426
IMAGE: ghcr.io/matrix-org/matrix-authentication-service
2527
IMAGE_SYN2MAS: ghcr.io/matrix-org/matrix-authentication-service/syn2mas
2628
BUILDCACHE: ghcr.io/matrix-org/matrix-authentication-service/buildcache
@@ -54,10 +56,8 @@ jobs:
5456
x86_64-apple-darwin
5557
aarch64-apple-darwin
5658
57-
- name: Setup Rust build cache
58-
uses: Swatinem/[email protected]
59-
with:
60-
save-if: "${{ github.event_name != 'pull_request' }}"
59+
- name: Setup sccache
60+
uses: mozilla-actions/[email protected]
6161

6262
- name: Install zig
6363
uses: goto-bus-stop/setup-zig@v2

.github/workflows/ci.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ concurrency:
1515
env:
1616
CARGO_TERM_COLOR: always
1717
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
18+
SCCACHE_GHA_ENABLED: "true"
19+
RUSTC_WRAPPER: "sccache"
1820

1921
jobs:
2022
opa-lint:
@@ -116,6 +118,10 @@ jobs:
116118
name: Run `cargo deny` checks
117119
runs-on: ubuntu-latest
118120

121+
env:
122+
# We need to remove the sccache wrapper because we don't install it in this job
123+
RUSTC_WRAPPER: ""
124+
119125
permissions:
120126
contents: read
121127

@@ -143,10 +149,8 @@ jobs:
143149
rustup toolchain install stable
144150
rustup default stable
145151
146-
- name: Setup Rust cache
147-
uses: Swatinem/[email protected]
148-
with:
149-
save-if: "${{ github.event_name != 'pull_request' }}"
152+
- name: Setup sccache
153+
uses: mozilla-actions/[email protected]
150154

151155
- name: Install Node
152156
uses: actions/[email protected]
@@ -204,10 +208,8 @@ jobs:
204208
working-directory: ./policies
205209
run: make
206210

207-
- name: Setup Rust cache
208-
uses: Swatinem/[email protected]
209-
with:
210-
save-if: "${{ github.event_name != 'pull_request' }}"
211+
- name: Setup sccache
212+
uses: mozilla-actions/[email protected]
211213

212214
- name: Run clippy
213215
run: |
@@ -268,10 +270,8 @@ jobs:
268270
working-directory: ./policies
269271
run: make
270272

271-
- name: Setup Rust cache
272-
uses: Swatinem/[email protected]
273-
with:
274-
save-if: "${{ github.event_name != 'pull_request' }}"
273+
- name: Setup sccache
274+
uses: mozilla-actions/[email protected]
275275

276276
- name: Test
277277
id: test

.github/workflows/coverage.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ jobs:
7878
permissions:
7979
contents: read
8080

81+
env:
82+
SCCACHE_GHA_ENABLED: "true"
83+
RUSTC_WRAPPER: "sccache"
84+
8185
services:
8286
postgres:
8387
image: docker.io/library/postgres:15.3
@@ -125,10 +129,8 @@ jobs:
125129
working-directory: ./policies
126130
run: make
127131

128-
- name: Setup Rust cache
129-
uses: Swatinem/[email protected]
130-
with:
131-
save-if: "${{ github.event_name != 'pull_request' }}"
132+
- name: Setup sccache
133+
uses: mozilla-actions/[email protected]
132134

133135
- name: Download grcov
134136
run: |

.github/workflows/docs.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ jobs:
2727
rustup toolchain install stable
2828
rustup default stable
2929
30-
- name: Setup Rust cache
31-
uses: Swatinem/[email protected]
32-
with:
33-
save-if: "${{ github.event_name != 'pull_request' }}"
30+
- name: Setup sccache
31+
uses: mozilla-actions/[email protected]
3432

3533
- name: Setup mdBook
3634
uses: peaceiris/[email protected]

0 commit comments

Comments
 (0)