Skip to content

Commit 0ec902f

Browse files
authored
Implement Cargo caching (#5)
Add Swatinem's Rust-Cache@v2 action to build, test and deploy pipelines
1 parent ef8c3c1 commit 0ec902f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

.github/workflows/build_and_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
with:
2828
toolchain: ${{ matrix.toolchain }}
2929
override: true
30+
- name: Setup Cargo cache
31+
uses: Swatinem/rust-cache@v2
3032
- name: Build using ${{ matrix.toolchain }} for ${{ matrix.os }}
3133
uses: actions-rs/cargo@v1
3234
with:
@@ -57,6 +59,8 @@ jobs:
5759
with:
5860
toolchain: ${{ matrix.toolchain }}
5961
override: true
62+
- name: Setup Cargo cache
63+
uses: Swatinem/rust-cache@v2
6064
- name: Test using ${{ matrix.toolchain }} for ${{ matrix.os }}
6165
uses: actions-rs/cargo@v1
6266
with:

.github/workflows/deploy_prerelease.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
with:
1717
toolchain: stable-x86_64-unknown-linux-gnu
1818
override: true
19+
- name: Setup Cargo cache
20+
uses: Swatinem/rust-cache@v2
1921
- name: Package
2022
uses: actions-rs/cargo@v1
2123
with:

.github/workflows/deploy_release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
with:
1515
toolchain: stable-x86_64-unknown-linux-gnu
1616
override: true
17+
- name: Setup Cargo cache
18+
uses: Swatinem/rust-cache@v2
1719
- name: Login to crates.io
1820
uses: actions-rs/cargo@v1
1921
with:
@@ -37,6 +39,8 @@ jobs:
3739
with:
3840
toolchain: stable-x86_64-unknown-linux-gnu
3941
override: true
42+
- name: Setup Cargo cache
43+
uses: Swatinem/rust-cache@v2
4044
- name: Package
4145
uses: actions-rs/cargo@v1
4246
with:

0 commit comments

Comments
 (0)