Skip to content

Commit 091a148

Browse files
Enhance CI workflow: Integrate sccache for improved build caching and performance
1 parent a171434 commit 091a148

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/rustls-rustcrypto.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ jobs:
2424
with:
2525
toolchain: 1.88.0
2626
components: clippy
27+
- uses: mozilla-actions/[email protected]
2728
- uses: Swatinem/rust-cache@v2
2829
- run: cargo clippy --all --all-features -- -D warnings
30+
env:
31+
SCCACHE_GHA_ENABLED: "true"
32+
RUSTC_WRAPPER: "sccache"
2933

3034
doc:
3135
runs-on: ubuntu-latest
@@ -34,8 +38,12 @@ jobs:
3438
- uses: dtolnay/rust-toolchain@master
3539
with:
3640
toolchain: stable
41+
- uses: mozilla-actions/[email protected]
3742
- uses: Swatinem/rust-cache@v2
3843
- run: cargo doc --all-features --no-deps
44+
env:
45+
SCCACHE_GHA_ENABLED: "true"
46+
RUSTC_WRAPPER: "sccache"
3947

4048
rustfmt:
4149
runs-on: ubuntu-latest
@@ -74,11 +82,14 @@ jobs:
7482
with:
7583
toolchain: ${{ matrix.rust }}
7684
targets: ${{ matrix.target }}
85+
- uses: mozilla-actions/[email protected]
7786
- uses: Swatinem/rust-cache@v2
7887
with:
7988
key: ${{ matrix.target }}
8089
- run: cargo build --no-default-features --features tls12,full,alloc --release --target ${{ matrix.target }}
8190
env:
91+
SCCACHE_GHA_ENABLED: "true"
92+
RUSTC_WRAPPER: "sccache"
8293
RUSTFLAGS: --cfg getrandom_backend="custom"
8394
test:
8495
strategy:
@@ -92,12 +103,21 @@ jobs:
92103
- uses: dtolnay/rust-toolchain@master
93104
with:
94105
toolchain: ${{ matrix.toolchain }}
106+
- uses: mozilla-actions/[email protected]
95107
- uses: Swatinem/rust-cache@v2
96108
with:
97109
key: ${{ matrix.toolchain }}
98110
- run: cargo test --features tls12
111+
env:
112+
SCCACHE_GHA_ENABLED: "true"
113+
RUSTC_WRAPPER: "sccache"
99114
- name: Test no_std with alloc
100115
run: cargo test --no-default-features --features tls12,full,alloc
116+
env:
117+
SCCACHE_GHA_ENABLED: "true"
118+
RUSTC_WRAPPER: "sccache"
119+
- name: Show sccache stats
120+
run: ${SCCACHE_PATH} --show-stats
101121

102122
cross:
103123
strategy:

0 commit comments

Comments
 (0)