Skip to content

Commit c3bbf23

Browse files
PiotrSikoraSwaagie
authored andcommitted
Cache artifacts in all GitHub Actions when testing locally. (proxy-wasm#278)
Signed-off-by: Piotr Sikora <[email protected]>
1 parent 3bccd94 commit c3bbf23

File tree

1 file changed

+112
-6
lines changed

1 file changed

+112
-6
lines changed

.github/workflows/rust.yml

Lines changed: 112 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ jobs:
3838
with:
3939
go-version: '^1.16'
4040

41+
- name: Cache
42+
if: ${{ env.ACT }}
43+
uses: actions/cache@v2
44+
with:
45+
path: |
46+
~/go/pkg/mod
47+
key: licenses-${{ hashFiles('.github/workflows/rust.yml') }}
48+
4149
- name: Check licenses
4250
run: |
4351
go install github.com/google/addlicense@latest
@@ -53,11 +61,6 @@ jobs:
5361
with:
5462
go-version: '^1.16'
5563

56-
- name: Install dependencies
57-
if: ${{ env.ACT }}
58-
run: |
59-
go install github.com/bazelbuild/[email protected]
60-
6164
- name: Cache
6265
uses: actions/cache@v2
6366
with:
@@ -66,9 +69,16 @@ jobs:
6669
~/.cache/bazelisk
6770
~/.cargo/.crates.toml
6871
~/.cargo/.crates2.json
72+
~/.cargo/advisory-db
6973
~/.cargo/bin
7074
~/.cargo/registry
71-
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
75+
~/go/pkg/mod
76+
key: bazel-${{ hashFiles('BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
77+
78+
- name: Install dependencies
79+
if: ${{ env.ACT }}
80+
run: |
81+
go install github.com/bazelbuild/[email protected]
7282
7383
- name: Build (wasm32-unknown-unknown)
7484
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //...
@@ -96,6 +106,20 @@ jobs:
96106
steps:
97107
- uses: actions/checkout@v2
98108

109+
- name: Cache
110+
if: ${{ env.ACT }}
111+
uses: actions/cache@v2
112+
with:
113+
path: |
114+
~/.cargo/.crates.toml
115+
~/.cargo/.crates2.json
116+
~/.cargo/advisory-db
117+
~/.cargo/bin
118+
~/.cargo/registry
119+
~/.rustup
120+
**/target
121+
key: msrv-${{ hashFiles('Cargo.toml') }}
122+
99123
- name: Install dependencies
100124
if: ${{ env.ACT }}
101125
run: |
@@ -145,6 +169,20 @@ jobs:
145169
steps:
146170
- uses: actions/checkout@v2
147171

172+
- name: Cache
173+
if: ${{ env.ACT }}
174+
uses: actions/cache@v2
175+
with:
176+
path: |
177+
~/.cargo/.crates.toml
178+
~/.cargo/.crates2.json
179+
~/.cargo/advisory-db
180+
~/.cargo/bin
181+
~/.cargo/registry
182+
~/.rustup
183+
**/target
184+
key: stable-${{ hashFiles('Cargo.toml') }}
185+
148186
- name: Install dependencies
149187
if: ${{ env.ACT }}
150188
run: |
@@ -193,6 +231,20 @@ jobs:
193231
steps:
194232
- uses: actions/checkout@v2
195233

234+
- name: Cache
235+
if: ${{ env.ACT }}
236+
uses: actions/cache@v2
237+
with:
238+
path: |
239+
~/.cargo/.crates.toml
240+
~/.cargo/.crates2.json
241+
~/.cargo/advisory-db
242+
~/.cargo/bin
243+
~/.cargo/registry
244+
~/.rustup
245+
**/target
246+
key: nightly-${{ hashFiles('Cargo.toml') }}
247+
196248
- name: Install dependencies
197249
if: ${{ env.ACT }}
198250
run: |
@@ -239,6 +291,19 @@ jobs:
239291
steps:
240292
- uses: actions/checkout@v2
241293

294+
- name: Cache
295+
if: ${{ env.ACT }}
296+
uses: actions/cache@v2
297+
with:
298+
path: |
299+
~/.cargo/.crates.toml
300+
~/.cargo/.crates2.json
301+
~/.cargo/advisory-db
302+
~/.cargo/bin
303+
~/.cargo/registry
304+
~/.rustup
305+
key: outdated-${{ hashFiles('Cargo.toml') }}
306+
242307
- name: Install dependencies
243308
if: ${{ env.ACT }}
244309
run: |
@@ -259,6 +324,19 @@ jobs:
259324
steps:
260325
- uses: actions/checkout@v2
261326

327+
- name: Cache
328+
if: ${{ env.ACT }}
329+
uses: actions/cache@v2
330+
with:
331+
path: |
332+
~/.cargo/.crates.toml
333+
~/.cargo/.crates2.json
334+
~/.cargo/advisory-db
335+
~/.cargo/bin
336+
~/.cargo/registry
337+
~/.rustup
338+
key: audit-${{ hashFiles('Cargo.toml') }}
339+
262340
- name: Install dependencies
263341
if: ${{ env.ACT }}
264342
run: |
@@ -299,6 +377,20 @@ jobs:
299377
steps:
300378
- uses: actions/checkout@v2
301379

380+
- name: Cache
381+
if: ${{ env.ACT }}
382+
uses: actions/cache@v2
383+
with:
384+
path: |
385+
~/.cargo/.crates.toml
386+
~/.cargo/.crates2.json
387+
~/.cargo/advisory-db
388+
~/.cargo/bin
389+
~/.cargo/registry
390+
~/.rustup
391+
**/target
392+
key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
393+
302394
- name: Install dependencies
303395
if: ${{ env.ACT }}
304396
run: |
@@ -366,6 +458,20 @@ jobs:
366458
steps:
367459
- uses: actions/checkout@v2
368460

461+
- name: Cache
462+
if: ${{ env.ACT }}
463+
uses: actions/cache@v2
464+
with:
465+
path: |
466+
~/.cargo/.crates.toml
467+
~/.cargo/.crates2.json
468+
~/.cargo/advisory-db
469+
~/.cargo/bin
470+
~/.cargo/registry
471+
~/.rustup
472+
**/target
473+
key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
474+
369475
- name: Install dependencies
370476
if: ${{ env.ACT }}
371477
run: |

0 commit comments

Comments
 (0)