Skip to content

Commit 936c4e1

Browse files
ci: Enable caching
Now that most jobs are on the stable channel, enabling caching should be more effective than it would have been on nightly.
1 parent 61840e0 commit 936c4e1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/rust.yml

+20
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- name: Checkout sources
2121
uses: actions/checkout@v3
2222

23+
- uses: Swatinem/rust-cache@v2
24+
2325
- name: Install qemu and OVMF
2426
run: |
2527
sudo apt-get update
@@ -36,6 +38,8 @@ jobs:
3638
- name: Checkout sources
3739
uses: actions/checkout@v3
3840

41+
- uses: Swatinem/rust-cache@v2
42+
3943
- name: Install qemu and OVMF
4044
run: |
4145
sudo apt-get update
@@ -52,6 +56,8 @@ jobs:
5256
- name: Checkout sources
5357
uses: actions/checkout@v3
5458

59+
- uses: Swatinem/rust-cache@v2
60+
5561
- name: Install qemu and OVMF
5662
run: |
5763
sudo apt-get update
@@ -68,6 +74,8 @@ jobs:
6874
- name: Checkout sources
6975
uses: actions/checkout@v3
7076

77+
- uses: Swatinem/rust-cache@v2
78+
7179
- name: Run cargo test (without unstable)
7280
run: cargo xtask test
7381

@@ -78,6 +86,8 @@ jobs:
7886
- name: Checkout sources
7987
uses: actions/checkout@v3
8088

89+
- uses: Swatinem/rust-cache@v2
90+
8191
- name: Run cargo fmt
8292
run: |
8393
rustup component add rustfmt
@@ -111,6 +121,8 @@ jobs:
111121
- name: Set MSRV toolchain
112122
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml
113123

124+
- uses: Swatinem/rust-cache@v2
125+
114126
- name: Build
115127
run: cargo xtask test-latest-release
116128

@@ -124,6 +136,8 @@ jobs:
124136
- name: Checkout sources
125137
uses: actions/checkout@v3
126138

139+
- uses: Swatinem/rust-cache@v2
140+
127141
- name: Run VM tests
128142
run: cargo xtask run --target x86_64 --ci
129143
timeout-minutes: 6
@@ -143,6 +157,8 @@ jobs:
143157
- name: Set toolchain
144158
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml
145159

160+
- uses: Swatinem/rust-cache@v2
161+
146162
- name: Build
147163
run: cargo xtask build
148164

@@ -158,6 +174,8 @@ jobs:
158174
- name: Set nightly toolchain so that `unstable` can be included
159175
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml
160176

177+
- uses: Swatinem/rust-cache@v2
178+
161179
- name: Build
162180
run: cargo xtask build --feature-permutations
163181

@@ -176,6 +194,8 @@ jobs:
176194
- name: Enable nightly toolchain
177195
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml
178196

197+
- uses: Swatinem/rust-cache@v2
198+
179199
- name: Run VM tests with the `unstable` feature
180200
run: cargo xtask run --target x86_64 --headless --ci --unstable
181201
timeout-minutes: 4

0 commit comments

Comments
 (0)