Skip to content

Commit 702e408

Browse files
authored
Merge branch 'main' into drop-bytes
2 parents ca9673a + ab305df commit 702e408

21 files changed

+375
-111
lines changed

.actrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-P ubuntu-24.04=catthehacker/ubuntu:act-24.04

.github/workflows/rust.yml

+75-72
Original file line numberDiff line numberDiff line change
@@ -30,39 +30,42 @@ on:
3030
jobs:
3131

3232
licenses:
33-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-24.04
3434

3535
steps:
36-
- uses: actions/checkout@v2
37-
- uses: actions/setup-go@v2
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-go@v5
3838
with:
3939
go-version: '^1.16'
4040

4141
- name: Cache
4242
if: ${{ env.ACT }}
43-
uses: actions/cache@v2
43+
uses: actions/cache@v4
4444
with:
4545
path: |
4646
~/go/pkg/mod
4747
key: licenses-${{ hashFiles('.github/workflows/rust.yml') }}
4848

49-
- name: Check licenses
49+
- name: Install dependencies
5050
run: |
51-
go install github.com/google/addlicense@latest
51+
go install github.com/google/addlicense@v1.1.1
5252
export PATH=$PATH:$(go env GOPATH)/bin
53+
54+
- name: Check licenses
55+
run: |
5356
addlicense -check -ignore "bazel/cargo/remote/**" .
5457
5558
bazel:
56-
runs-on: ubuntu-latest
59+
runs-on: ubuntu-24.04
5760

5861
steps:
59-
- uses: actions/checkout@v2
60-
- uses: actions/setup-go@v2
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-go@v5
6164
with:
6265
go-version: '^1.16'
6366

6467
- name: Cache
65-
uses: actions/cache@v2
68+
uses: actions/cache@v4
6669
with:
6770
path: |
6871
~/.cache/bazel
@@ -73,12 +76,13 @@ jobs:
7376
~/.cargo/bin
7477
~/.cargo/registry
7578
~/go/pkg/mod
76-
key: bazel-${{ hashFiles('BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
79+
key: bazel-${{ hashFiles('.github/workflows/rust.yml', 'BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
7780

7881
- name: Install dependencies
79-
if: ${{ env.ACT }}
8082
run: |
81-
go install github.com/bazelbuild/[email protected]
83+
go install github.com/bazelbuild/[email protected]
84+
go install github.com/bazelbuild/buildtools/[email protected]
85+
export PATH=$PATH:$(go env GOPATH)/bin
8286
8387
- name: Build (wasm32-unknown-unknown)
8488
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //...
@@ -88,8 +92,6 @@ jobs:
8892

8993
- name: Format (buildifier)
9094
run: |
91-
go install github.com/bazelbuild/buildtools/buildifier@latest
92-
export PATH=$PATH:$(go env GOPATH)/bin
9395
buildifier -mode=check -r .
9496
9597
- name: Format (rules_rust)
@@ -98,17 +100,17 @@ jobs:
98100
git diff --exit-code
99101
100102
msrv:
101-
runs-on: ubuntu-latest
103+
runs-on: ubuntu-24.04
102104

103105
env:
104106
RUSTFLAGS: -D warnings
105107

106108
steps:
107-
- uses: actions/checkout@v2
109+
- uses: actions/checkout@v4
108110

109111
- name: Cache
110112
if: ${{ env.ACT }}
111-
uses: actions/cache@v2
113+
uses: actions/cache@v4
112114
with:
113115
path: |
114116
~/.cargo/.crates.toml
@@ -120,7 +122,7 @@ jobs:
120122
**/target
121123
key: msrv-${{ hashFiles('Cargo.toml') }}
122124

123-
- name: Install dependencies
125+
- name: Install Rustup
124126
if: ${{ env.ACT }}
125127
run: |
126128
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -161,17 +163,17 @@ jobs:
161163
run: cargo publish --dry-run --target=wasm32-unknown-unknown
162164

163165
stable:
164-
runs-on: ubuntu-latest
166+
runs-on: ubuntu-24.04
165167

166168
env:
167169
RUSTFLAGS: -D warnings
168170

169171
steps:
170-
- uses: actions/checkout@v2
172+
- uses: actions/checkout@v4
171173

172174
- name: Cache
173175
if: ${{ env.ACT }}
174-
uses: actions/cache@v2
176+
uses: actions/cache@v4
175177
with:
176178
path: |
177179
~/.cargo/.crates.toml
@@ -183,7 +185,7 @@ jobs:
183185
**/target
184186
key: stable-${{ hashFiles('Cargo.toml') }}
185187

186-
- name: Install dependencies
188+
- name: Install Rustup
187189
if: ${{ env.ACT }}
188190
run: |
189191
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -223,17 +225,17 @@ jobs:
223225
run: cargo publish --dry-run --target=wasm32-unknown-unknown
224226

225227
nightly:
226-
runs-on: ubuntu-latest
228+
runs-on: ubuntu-24.04
227229

228230
env:
229231
RUSTFLAGS: -D warnings
230232

231233
steps:
232-
- uses: actions/checkout@v2
234+
- uses: actions/checkout@v4
233235

234236
- name: Cache
235237
if: ${{ env.ACT }}
236-
uses: actions/cache@v2
238+
uses: actions/cache@v4
237239
with:
238240
path: |
239241
~/.cargo/.crates.toml
@@ -245,7 +247,7 @@ jobs:
245247
**/target
246248
key: nightly-${{ hashFiles('Cargo.toml') }}
247249

248-
- name: Install dependencies
250+
- name: Install Rustup
249251
if: ${{ env.ACT }}
250252
run: |
251253
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -286,14 +288,13 @@ jobs:
286288
run: cargo publish --dry-run --target=wasm32-unknown-unknown
287289

288290
outdated:
289-
runs-on: ubuntu-latest
291+
runs-on: ubuntu-24.04
290292

291293
steps:
292-
- uses: actions/checkout@v2
294+
- uses: actions/checkout@v4
293295

294296
- name: Cache
295-
if: ${{ env.ACT }}
296-
uses: actions/cache@v2
297+
uses: actions/cache@v4
297298
with:
298299
path: |
299300
~/.cargo/.crates.toml
@@ -302,31 +303,40 @@ jobs:
302303
~/.cargo/bin
303304
~/.cargo/registry
304305
~/.rustup
305-
key: outdated-${{ hashFiles('Cargo.toml') }}
306+
key: outdated-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }}
306307

307-
- name: Install dependencies
308+
- name: Install Rustup
308309
if: ${{ env.ACT }}
309310
run: |
310311
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
311312
chmod +x ./rustup-init.sh
312313
./rustup-init.sh -y
313314
rm rustup-init.sh
314315
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
315-
export PATH=$PATH:$HOME/.cargo/bin
316-
cargo install cargo-outdated
317316
318-
- name: Run cargo outdated
319-
run: cargo outdated --root-deps-only --exit-code 1
317+
- name: Install dependencies
318+
run: |
319+
cargo install cargo-outdated --version 0.16.0
320+
321+
- name: Run cargo outdated (main)
322+
run: |
323+
cargo outdated --root-deps-only --exit-code 1
324+
325+
- name: Run cargo outdated (examples)
326+
run: |
327+
for example in $(find examples -name Cargo.toml); do \
328+
cd $(dirname $GITHUB_WORKSPACE/$example); \
329+
cargo outdated --root-deps-only --exit-code 1; \
330+
done
320331
321332
audit:
322-
runs-on: ubuntu-latest
333+
runs-on: ubuntu-24.04
323334

324335
steps:
325-
- uses: actions/checkout@v2
336+
- uses: actions/checkout@v4
326337

327338
- name: Cache
328-
if: ${{ env.ACT }}
329-
uses: actions/cache@v2
339+
uses: actions/cache@v4
330340
with:
331341
path: |
332342
~/.cargo/.crates.toml
@@ -335,26 +345,35 @@ jobs:
335345
~/.cargo/bin
336346
~/.cargo/registry
337347
~/.rustup
338-
key: audit-${{ hashFiles('Cargo.toml') }}
348+
key: audit-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }}
339349

340-
- name: Install dependencies
350+
- name: Install Rustup
341351
if: ${{ env.ACT }}
342352
run: |
343353
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
344354
chmod +x ./rustup-init.sh
345355
./rustup-init.sh -y
346356
rm rustup-init.sh
347357
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
348-
export PATH=$PATH:$HOME/.cargo/bin
349-
cargo install cargo-audit
350358
351-
- name: Run cargo audit
359+
- name: Install dependencies
360+
run: |
361+
cargo install cargo-audit --version 0.21.0
362+
363+
- name: Run cargo audit (main)
352364
run: |
353365
cp -p bazel/cargo/Cargo.Bazel.lock Cargo.lock
354366
cargo audit
355367
368+
- name: Run cargo audit (examples)
369+
run: |
370+
for example in $(find examples -name Cargo.toml); do \
371+
cd $(dirname $GITHUB_WORKSPACE/$example); \
372+
cargo audit; \
373+
done
374+
356375
examples:
357-
runs-on: ubuntu-latest
376+
runs-on: ubuntu-24.04
358377

359378
strategy:
360379
matrix:
@@ -365,6 +384,7 @@ jobs:
365384
- 'http_config'
366385
- 'http_headers'
367386
- 'grpc_auth_random'
387+
- 'envoy_filter_metadata'
368388

369389
defaults:
370390
run:
@@ -374,11 +394,11 @@ jobs:
374394
RUSTFLAGS: -D warnings
375395

376396
steps:
377-
- uses: actions/checkout@v2
397+
- uses: actions/checkout@v4
378398

379399
- name: Cache
380400
if: ${{ env.ACT }}
381-
uses: actions/cache@v2
401+
uses: actions/cache@v4
382402
with:
383403
path: |
384404
~/.cargo/.crates.toml
@@ -390,7 +410,7 @@ jobs:
390410
**/target
391411
key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
392412

393-
- name: Install dependencies
413+
- name: Install Rustup
394414
if: ${{ env.ACT }}
395415
run: |
396416
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -416,14 +436,6 @@ jobs:
416436
- name: Format (manifest)
417437
run: cargo verify-project
418438

419-
- name: Run cargo audit
420-
if: ${{ !env.ACT }}
421-
run: cargo audit
422-
423-
- name: Run cargo outdated
424-
if: ${{ !env.ACT }}
425-
run: cargo outdated --root-deps-only --exit-code 1
426-
427439
- name: Validate Envoy config
428440
run: |
429441
docker run --rm \
@@ -434,7 +446,7 @@ jobs:
434446
-c envoy.yaml
435447
436448
reactors:
437-
runs-on: ubuntu-latest
449+
runs-on: ubuntu-24.04
438450

439451
strategy:
440452
matrix:
@@ -445,6 +457,7 @@ jobs:
445457
- 'http_config'
446458
- 'http_headers'
447459
- 'grpc_auth_random'
460+
- 'envoy_filter_metadata'
448461

449462
defaults:
450463
run:
@@ -454,11 +467,11 @@ jobs:
454467
RUSTFLAGS: -D warnings -Z wasi-exec-model=reactor
455468

456469
steps:
457-
- uses: actions/checkout@v2
470+
- uses: actions/checkout@v4
458471

459472
- name: Cache
460473
if: ${{ env.ACT }}
461-
uses: actions/cache@v2
474+
uses: actions/cache@v4
462475
with:
463476
path: |
464477
~/.cargo/.crates.toml
@@ -470,7 +483,7 @@ jobs:
470483
**/target
471484
key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
472485

473-
- name: Install dependencies
486+
- name: Install Rustup
474487
if: ${{ env.ACT }}
475488
run: |
476489
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -503,16 +516,6 @@ jobs:
503516
- name: Format (manifest)
504517
run: cargo verify-project
505518

506-
# TODO: Re-enable once cargo audit supports Cargo lockfile v4.
507-
#- name: Run cargo audit
508-
# if: ${{ !env.ACT }}
509-
# run: cargo audit
510-
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
515-
516519
- name: Rename .wasm to match expected filename
517520
run: |
518521
cd target/wasm32-wasip1/release

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [HTTP Response body](./examples/http_body/)
2323
- [HTTP Configuration](./examples/http_config/)
2424
- [gRPC Auth (random)](./examples/grpc_auth_random/)
25+
- [Envoy filter metadata](./examples/envoy_filter_metadata/)
2526

2627
## Articles & blog posts from the community
2728

0 commit comments

Comments
 (0)