Skip to content

Commit 2a020e9

Browse files
authored
Merge branch 'main' into test-serialization
2 parents c6acd5f + ab305df commit 2a020e9

21 files changed

+375
-111
lines changed

.actrc

Lines changed: 1 addition & 0 deletions
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

Lines changed: 75 additions & 72 deletions
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
@@ -164,17 +166,17 @@ jobs:
164166
run: cargo publish --dry-run --target=wasm32-unknown-unknown
165167

166168
stable:
167-
runs-on: ubuntu-latest
169+
runs-on: ubuntu-24.04
168170

169171
env:
170172
RUSTFLAGS: -D warnings
171173

172174
steps:
173-
- uses: actions/checkout@v2
175+
- uses: actions/checkout@v4
174176

175177
- name: Cache
176178
if: ${{ env.ACT }}
177-
uses: actions/cache@v2
179+
uses: actions/cache@v4
178180
with:
179181
path: |
180182
~/.cargo/.crates.toml
@@ -186,7 +188,7 @@ jobs:
186188
**/target
187189
key: stable-${{ hashFiles('Cargo.toml') }}
188190

189-
- name: Install dependencies
191+
- name: Install Rustup
190192
if: ${{ env.ACT }}
191193
run: |
192194
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -229,17 +231,17 @@ jobs:
229231
run: cargo publish --dry-run --target=wasm32-unknown-unknown
230232

231233
nightly:
232-
runs-on: ubuntu-latest
234+
runs-on: ubuntu-24.04
233235

234236
env:
235237
RUSTFLAGS: -D warnings
236238

237239
steps:
238-
- uses: actions/checkout@v2
240+
- uses: actions/checkout@v4
239241

240242
- name: Cache
241243
if: ${{ env.ACT }}
242-
uses: actions/cache@v2
244+
uses: actions/cache@v4
243245
with:
244246
path: |
245247
~/.cargo/.crates.toml
@@ -251,7 +253,7 @@ jobs:
251253
**/target
252254
key: nightly-${{ hashFiles('Cargo.toml') }}
253255

254-
- name: Install dependencies
256+
- name: Install Rustup
255257
if: ${{ env.ACT }}
256258
run: |
257259
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -298,14 +300,13 @@ jobs:
298300
run: cargo publish --dry-run --target=wasm32-unknown-unknown
299301

300302
outdated:
301-
runs-on: ubuntu-latest
303+
runs-on: ubuntu-24.04
302304

303305
steps:
304-
- uses: actions/checkout@v2
306+
- uses: actions/checkout@v4
305307

306308
- name: Cache
307-
if: ${{ env.ACT }}
308-
uses: actions/cache@v2
309+
uses: actions/cache@v4
309310
with:
310311
path: |
311312
~/.cargo/.crates.toml
@@ -314,31 +315,40 @@ jobs:
314315
~/.cargo/bin
315316
~/.cargo/registry
316317
~/.rustup
317-
key: outdated-${{ hashFiles('Cargo.toml') }}
318+
key: outdated-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }}
318319

319-
- name: Install dependencies
320+
- name: Install Rustup
320321
if: ${{ env.ACT }}
321322
run: |
322323
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
323324
chmod +x ./rustup-init.sh
324325
./rustup-init.sh -y
325326
rm rustup-init.sh
326327
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
327-
export PATH=$PATH:$HOME/.cargo/bin
328-
cargo install cargo-outdated
329328
330-
- name: Run cargo outdated
331-
run: cargo outdated --root-deps-only --exit-code 1
329+
- name: Install dependencies
330+
run: |
331+
cargo install cargo-outdated --version 0.16.0
332+
333+
- name: Run cargo outdated (main)
334+
run: |
335+
cargo outdated --root-deps-only --exit-code 1
336+
337+
- name: Run cargo outdated (examples)
338+
run: |
339+
for example in $(find examples -name Cargo.toml); do \
340+
cd $(dirname $GITHUB_WORKSPACE/$example); \
341+
cargo outdated --root-deps-only --exit-code 1; \
342+
done
332343
333344
audit:
334-
runs-on: ubuntu-latest
345+
runs-on: ubuntu-24.04
335346

336347
steps:
337-
- uses: actions/checkout@v2
348+
- uses: actions/checkout@v4
338349

339350
- name: Cache
340-
if: ${{ env.ACT }}
341-
uses: actions/cache@v2
351+
uses: actions/cache@v4
342352
with:
343353
path: |
344354
~/.cargo/.crates.toml
@@ -347,26 +357,35 @@ jobs:
347357
~/.cargo/bin
348358
~/.cargo/registry
349359
~/.rustup
350-
key: audit-${{ hashFiles('Cargo.toml') }}
360+
key: audit-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }}
351361

352-
- name: Install dependencies
362+
- name: Install Rustup
353363
if: ${{ env.ACT }}
354364
run: |
355365
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
356366
chmod +x ./rustup-init.sh
357367
./rustup-init.sh -y
358368
rm rustup-init.sh
359369
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
360-
export PATH=$PATH:$HOME/.cargo/bin
361-
cargo install cargo-audit
362370
363-
- name: Run cargo audit
371+
- name: Install dependencies
372+
run: |
373+
cargo install cargo-audit --version 0.21.0
374+
375+
- name: Run cargo audit (main)
364376
run: |
365377
cp -p bazel/cargo/Cargo.Bazel.lock Cargo.lock
366378
cargo audit
367379
380+
- name: Run cargo audit (examples)
381+
run: |
382+
for example in $(find examples -name Cargo.toml); do \
383+
cd $(dirname $GITHUB_WORKSPACE/$example); \
384+
cargo audit; \
385+
done
386+
368387
examples:
369-
runs-on: ubuntu-latest
388+
runs-on: ubuntu-24.04
370389

371390
strategy:
372391
matrix:
@@ -377,6 +396,7 @@ jobs:
377396
- 'http_config'
378397
- 'http_headers'
379398
- 'grpc_auth_random'
399+
- 'envoy_filter_metadata'
380400

381401
defaults:
382402
run:
@@ -386,11 +406,11 @@ jobs:
386406
RUSTFLAGS: -D warnings
387407

388408
steps:
389-
- uses: actions/checkout@v2
409+
- uses: actions/checkout@v4
390410

391411
- name: Cache
392412
if: ${{ env.ACT }}
393-
uses: actions/cache@v2
413+
uses: actions/cache@v4
394414
with:
395415
path: |
396416
~/.cargo/.crates.toml
@@ -402,7 +422,7 @@ jobs:
402422
**/target
403423
key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
404424

405-
- name: Install dependencies
425+
- name: Install Rustup
406426
if: ${{ env.ACT }}
407427
run: |
408428
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -428,14 +448,6 @@ jobs:
428448
- name: Format (manifest)
429449
run: cargo verify-project
430450

431-
- name: Run cargo audit
432-
if: ${{ !env.ACT }}
433-
run: cargo audit
434-
435-
- name: Run cargo outdated
436-
if: ${{ !env.ACT }}
437-
run: cargo outdated --root-deps-only --exit-code 1
438-
439451
- name: Validate Envoy config
440452
run: |
441453
docker run --rm \
@@ -446,7 +458,7 @@ jobs:
446458
-c envoy.yaml
447459
448460
reactors:
449-
runs-on: ubuntu-latest
461+
runs-on: ubuntu-24.04
450462

451463
strategy:
452464
matrix:
@@ -457,6 +469,7 @@ jobs:
457469
- 'http_config'
458470
- 'http_headers'
459471
- 'grpc_auth_random'
472+
- 'envoy_filter_metadata'
460473

461474
defaults:
462475
run:
@@ -466,11 +479,11 @@ jobs:
466479
RUSTFLAGS: -D warnings -Z wasi-exec-model=reactor
467480

468481
steps:
469-
- uses: actions/checkout@v2
482+
- uses: actions/checkout@v4
470483

471484
- name: Cache
472485
if: ${{ env.ACT }}
473-
uses: actions/cache@v2
486+
uses: actions/cache@v4
474487
with:
475488
path: |
476489
~/.cargo/.crates.toml
@@ -482,7 +495,7 @@ jobs:
482495
**/target
483496
key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
484497

485-
- name: Install dependencies
498+
- name: Install Rustup
486499
if: ${{ env.ACT }}
487500
run: |
488501
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
@@ -515,16 +528,6 @@ jobs:
515528
- name: Format (manifest)
516529
run: cargo verify-project
517530

518-
# TODO: Re-enable once cargo audit supports Cargo lockfile v4.
519-
#- name: Run cargo audit
520-
# if: ${{ !env.ACT }}
521-
# run: cargo audit
522-
523-
# TODO: Re-enable once cargo outdated supports Cargo lockfile v4.
524-
#- name: Run cargo outdated
525-
# if: ${{ !env.ACT }}
526-
# run: cargo outdated --root-deps-only --exit-code 1
527-
528531
- name: Rename .wasm to match expected filename
529532
run: |
530533
cd target/wasm32-wasip1/release

README.md

Lines changed: 1 addition & 0 deletions
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)