Skip to content

Commit d4a5408

Browse files
committed
ci: Add Rust workspace cache
1 parent 6764884 commit d4a5408

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
uses: dtolnay/rust-toolchain@stable
3131
with:
3232
components: clippy
33+
- name: Cache Rust workspace
34+
uses: Swatinem/rust-cache@v2
3335
- name: Cargo check
3436
run: cargo check --all-features --all-targets
3537
- name: Cargo clippy
@@ -85,6 +87,8 @@ jobs:
8587
uses: actions/checkout@v4
8688
- name: Setup Rust toolchain
8789
uses: dtolnay/rust-toolchain@stable
90+
- name: Cache Rust workspace
91+
uses: Swatinem/rust-cache@v2
8892
- name: Cargo test
8993
run: cargo test --release --all-features
9094

@@ -151,6 +155,10 @@ jobs:
151155
uses: dtolnay/rust-toolchain@stable
152156
with:
153157
targets: ${{ matrix.target }}
158+
- name: Cache Rust workspace
159+
uses: Swatinem/rust-cache@v2
160+
with:
161+
key: ${{ matrix.target }}
154162
- name: Cargo build
155163
run: >
156164
cargo ${{ matrix.build }} --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }}
@@ -202,6 +210,10 @@ jobs:
202210
uses: dtolnay/rust-toolchain@stable
203211
with:
204212
targets: ${{ matrix.target }}
213+
- name: Cache Rust workspace
214+
uses: Swatinem/rust-cache@v2
215+
with:
216+
key: ${{ matrix.target }}
205217
- name: Cargo build
206218
run: >
207219
cargo build --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }}

0 commit comments

Comments
 (0)