38
38
with :
39
39
go-version : ' ^1.16'
40
40
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
+
41
49
- name : Check licenses
42
50
run : |
43
51
go install github.com/google/addlicense@latest
53
61
with :
54
62
go-version : ' ^1.16'
55
63
56
- - name : Install dependencies
57
- if : ${{ env.ACT }}
58
- run : |
59
- go install github.com/bazelbuild/[email protected]
60
-
61
64
- name : Cache
62
65
uses : actions/cache@v2
63
66
with :
66
69
~/.cache/bazelisk
67
70
~/.cargo/.crates.toml
68
71
~/.cargo/.crates2.json
72
+ ~/.cargo/advisory-db
69
73
~/.cargo/bin
70
74
~/.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]
72
82
73
83
- name : Build (wasm32-unknown-unknown)
74
84
run : bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //...
80
90
run : |
81
91
go install github.com/bazelbuild/buildtools/buildifier@latest
82
92
export PATH=$PATH:$(go env GOPATH)/bin
83
- buildifier -mode=check WORKSPACE
84
- buildifier -mode=check BUILD
93
+ buildifier -mode=check -r .
85
94
86
95
- name : Format (rules_rust)
87
96
run : |
@@ -97,6 +106,20 @@ jobs:
97
106
steps :
98
107
- uses : actions/checkout@v2
99
108
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
+
100
123
- name : Install dependencies
101
124
if : ${{ env.ACT }}
102
125
run : |
@@ -146,6 +169,20 @@ jobs:
146
169
steps :
147
170
- uses : actions/checkout@v2
148
171
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
+
149
186
- name : Install dependencies
150
187
if : ${{ env.ACT }}
151
188
run : |
@@ -194,6 +231,20 @@ jobs:
194
231
steps :
195
232
- uses : actions/checkout@v2
196
233
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
+
197
248
- name : Install dependencies
198
249
if : ${{ env.ACT }}
199
250
run : |
@@ -240,6 +291,19 @@ jobs:
240
291
steps :
241
292
- uses : actions/checkout@v2
242
293
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
+
243
307
- name : Install dependencies
244
308
if : ${{ env.ACT }}
245
309
run : |
@@ -260,6 +324,19 @@ jobs:
260
324
steps :
261
325
- uses : actions/checkout@v2
262
326
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
+
263
340
- name : Install dependencies
264
341
if : ${{ env.ACT }}
265
342
run : |
@@ -276,7 +353,7 @@ jobs:
276
353
cp -p bazel/cargo/Cargo.Bazel.lock Cargo.lock
277
354
cargo audit
278
355
279
- example :
356
+ examples :
280
357
runs-on : ubuntu-latest
281
358
282
359
strategy :
@@ -299,6 +376,20 @@ jobs:
299
376
steps :
300
377
- uses : actions/checkout@v2
301
378
379
+ - name : Cache
380
+ if : ${{ env.ACT }}
381
+ uses : actions/cache@v2
382
+ with :
383
+ path : |
384
+ ~/.cargo/.crates.toml
385
+ ~/.cargo/.crates2.json
386
+ ~/.cargo/advisory-db
387
+ ~/.cargo/bin
388
+ ~/.cargo/registry
389
+ ~/.rustup
390
+ **/target
391
+ key : example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
392
+
302
393
- name : Install dependencies
303
394
if : ${{ env.ACT }}
304
395
run : |
@@ -326,9 +417,11 @@ jobs:
326
417
run : cargo verify-project
327
418
328
419
- name : Run cargo audit
420
+ if : ${{ !env.ACT }}
329
421
run : cargo audit
330
422
331
423
- name : Run cargo outdated
424
+ if : ${{ !env.ACT }}
332
425
run : cargo outdated --root-deps-only --exit-code 1
333
426
334
427
- name : Validate Envoy config
@@ -340,7 +433,7 @@ jobs:
340
433
--mode validate \
341
434
-c envoy.yaml
342
435
343
- reactor :
436
+ reactors :
344
437
runs-on : ubuntu-latest
345
438
346
439
strategy :
@@ -363,12 +456,26 @@ jobs:
363
456
steps :
364
457
- uses : actions/checkout@v2
365
458
459
+ - name : Cache
460
+ if : ${{ env.ACT }}
461
+ uses : actions/cache@v2
462
+ with :
463
+ path : |
464
+ ~/.cargo/.crates.toml
465
+ ~/.cargo/.crates2.json
466
+ ~/.cargo/advisory-db
467
+ ~/.cargo/bin
468
+ ~/.cargo/registry
469
+ ~/.rustup
470
+ **/target
471
+ key : reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
472
+
366
473
- name : Install dependencies
367
474
if : ${{ env.ACT }}
368
475
run : |
369
476
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
370
477
chmod +x ./rustup-init.sh
371
- ./rustup-init.sh -y
478
+ ./rustup-init.sh -y --default-toolchain nightly
372
479
rm rustup-init.sh
373
480
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
374
481
@@ -396,11 +503,15 @@ jobs:
396
503
- name : Format (manifest)
397
504
run : cargo verify-project
398
505
399
- - name : Run cargo audit
400
- run : cargo audit
506
+ # TODO: Re-enable once cargo audit supports Cargo lockfile v4.
507
+ # - name: Run cargo audit
508
+ # if: ${{ !env.ACT }}
509
+ # run: cargo audit
401
510
402
- - name : Run cargo outdated
403
- run : cargo outdated --root-deps-only --exit-code 1
511
+ # TODO: Re-enable once cargo outdated supports Cargo lockfile v4.
512
+ # - name: Run cargo outdated
513
+ # if: ${{ !env.ACT }}
514
+ # run: cargo outdated --root-deps-only --exit-code 1
404
515
405
516
- name : Rename .wasm to match expected filename
406
517
run : |
0 commit comments