Skip to content

Commit f5ef8e8

Browse files
authored
ci: Use Swatinem/rust-cache@v2 to cache (#644)
1 parent b43d700 commit f5ef8e8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/CI.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v6
1414
- uses: dtolnay/rust-toolchain@stable
15+
- uses: Swatinem/rust-cache@v2
16+
with:
17+
save-if: ${{ github.ref == 'refs/heads/main' }}
1518
- run: cargo check --workspace --all-features --all-targets
1619

1720
check-docs:
@@ -30,6 +33,9 @@ jobs:
3033
steps:
3134
- uses: actions/checkout@v6
3235
- uses: dtolnay/rust-toolchain@stable
36+
- uses: Swatinem/rust-cache@v2
37+
with:
38+
save-if: ${{ github.ref == 'refs/heads/main' }}
3339
- uses: taiki-e/install-action@cargo-hack
3440
- name: cargo hack check
3541
working-directory: ${{ matrix.subcrate }}
@@ -49,6 +55,10 @@ jobs:
4955
- uses: dtolnay/rust-toolchain@master
5056
with:
5157
toolchain: ${{ matrix.rust }}
58+
- uses: Swatinem/rust-cache@v2
59+
if: matrix.rust != 'nightly'
60+
with:
61+
save-if: ${{ github.ref == 'refs/heads/main' }}
5262
- run: cargo test --workspace --all-features
5363

5464
test-msrv:
@@ -67,6 +77,9 @@ jobs:
6777
- run: cargo update -p async-compression --precise 0.4.23
6878
- run: cargo update -p flate2 --precise 1.0.35
6979
- uses: dtolnay/rust-toolchain@1.64
80+
- uses: Swatinem/rust-cache@v2
81+
with:
82+
save-if: ${{ github.ref == 'refs/heads/main' }}
7083
- run: cargo check -p tower-http --all-features
7184

7285
style:
@@ -107,5 +120,7 @@ jobs:
107120
with:
108121
tool: cargo-check-external-types@0.4.0
109122
- uses: Swatinem/rust-cache@v2
123+
with:
124+
save-if: ${{ github.ref == 'refs/heads/main' }}
110125
- run: cargo check-external-types --all-features
111126
working-directory: tower-http

0 commit comments

Comments
 (0)