7777 export PATH=$PATH:$(go env GOPATH)/bin
7878 buildifier -mode=check WORKSPACE
7979 buildifier -mode=check BUILD
80- buildifier -mode=check examples/BUILD
8180
8281 - name : Format (cargo raze)
8382 run : |
8988 stable :
9089 runs-on : ubuntu-latest
9190
91+ env :
92+ RUSTFLAGS : -D warnings
93+
9294 steps :
9395 - uses : actions/checkout@v2
9496
@@ -99,23 +101,15 @@ jobs:
99101 rustup target add wasm32-wasi
100102
101103 - name : Build (wasm32-unknown-unknown)
102- env :
103- RUSTFLAGS : -D warnings
104104 run : cargo build --release --all-targets --target=wasm32-unknown-unknown
105105
106106 - name : Clippy (wasm32-unknown-unknown)
107- env :
108- RUSTFLAGS : -D warnings
109107 run : cargo clippy --release --all-targets --target=wasm32-unknown-unknown
110108
111109 - name : Build (wasm32-wasi)
112- env :
113- RUSTFLAGS : -D warnings
114110 run : cargo build --release --all-targets --target=wasm32-wasi
115111
116112 - name : Clippy (wasm32-wasi)
117- env :
118- RUSTFLAGS : -D warnings
119113 run : cargo clippy --release --all-targets --target=wasm32-wasi
120114
121115 - name : Format (rustfmt)
@@ -133,6 +127,9 @@ jobs:
133127 nightly :
134128 runs-on : ubuntu-latest
135129
130+ env :
131+ RUSTFLAGS : -D warnings
132+
136133 steps :
137134 - uses : actions/checkout@v2
138135
@@ -144,23 +141,15 @@ jobs:
144141 rustup default nightly
145142
146143 - name : Build (wasm32-unknown-unknown)
147- env :
148- RUSTFLAGS : -D warnings
149144 run : cargo build --release --all-targets --target=wasm32-unknown-unknown
150145
151146 - name : Clippy (wasm32-unknown-unknown)
152- env :
153- RUSTFLAGS : -D warnings
154147 run : cargo clippy --release --all-targets --target=wasm32-unknown-unknown
155148
156149 - name : Build (wasm32-wasi)
157- env :
158- RUSTFLAGS : -D warnings
159150 run : cargo build --release --all-targets --target=wasm32-wasi
160151
161152 - name : Clippy (wasm32-wasi)
162- env :
163- RUSTFLAGS : -D warnings
164153 run : cargo clippy --release --all-targets --target=wasm32-wasi
165154
166155 - name : Format (rustfmt)
@@ -175,49 +164,144 @@ jobs:
175164 - name : Package (publish)
176165 run : cargo publish --dry-run --target=wasm32-unknown-unknown
177166
178- reactor :
167+ outdated :
179168 runs-on : ubuntu-latest
180169
181170 steps :
182171 - uses : actions/checkout@v2
183172
184- - name : Update Rust
173+ - name : Run cargo outdated
174+ run : cargo outdated --root-deps-only --exit-code 1
175+
176+ audit :
177+ runs-on : ubuntu-latest
178+
179+ steps :
180+ - uses : actions/checkout@v2
181+
182+ - name : Run cargo audit
185183 run : |
186- rustup toolchain install nightly --component clippy
187- rustup +nightly target add wasm32-wasi
188- rustup default nightly
184+ cp -p bazel/cargo/Cargo.raze.lock .
185+ cargo audit
189186
190- - name : Rewrite Cargo.toml examples
187+ example :
188+ runs-on : ubuntu-latest
189+
190+ strategy :
191+ matrix :
192+ example :
193+ - ' hello_world'
194+ - ' http_auth_random'
195+ - ' http_body'
196+ - ' http_config'
197+ - ' http_headers'
198+
199+ defaults :
200+ run :
201+ working-directory : ./examples/${{ matrix.example }}
202+
203+ env :
204+ RUSTFLAGS : -D warnings
205+
206+ steps :
207+ - uses : actions/checkout@v2
208+
209+ - name : Update Rust
191210 run : |
192- grep -v '^crate-type' Cargo.toml > Cargo.tmp
193- mv Cargo.tmp Cargo.toml
211+ rustup toolchain install stable --component clippy --component rustfmt
212+ rustup target add wasm32-wasi
194213
195214 - name : Build (wasm32-wasi)
196- env :
197- RUSTFLAGS : -D warnings -Z wasi-exec-model=reactor
198- run : cargo build --release --all-targets --target=wasm32-wasi
215+ run : cargo build --release --target=wasm32-wasi
199216
200217 - name : Clippy (wasm32-wasi)
201- env :
202- RUSTFLAGS : -D warnings -Z wasi-exec-model=reactor
203- run : cargo clippy --release --all-targets --target=wasm32-wasi
218+ run : cargo clippy --release --target=wasm32-wasi
204219
205- outdated :
206- runs-on : ubuntu-latest
220+ - name : Format (rustfmt)
221+ run : cargo fmt -- --check
207222
208- steps :
209- - uses : actions/checkout@v2
223+ - name : Format (manifest)
224+ run : cargo verify-project
225+
226+ - name : Run cargo audit
227+ run : cargo audit
210228
211229 - name : Run cargo outdated
212230 run : cargo outdated --root-deps-only --exit-code 1
213231
214- audit :
232+ - name : Validate Envoy config
233+ run : |
234+ docker run --rm \
235+ -v $(pwd)/envoy.yaml:/envoy.yaml \
236+ -v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \
237+ envoyproxy/envoy:v1.24-latest \
238+ --mode validate \
239+ -c envoy.yaml
240+
241+ reactor :
215242 runs-on : ubuntu-latest
216243
244+ strategy :
245+ matrix :
246+ example :
247+ - ' hello_world'
248+ - ' http_auth_random'
249+ - ' http_body'
250+ - ' http_config'
251+ - ' http_headers'
252+
253+ defaults :
254+ run :
255+ working-directory : ./examples/${{ matrix.example }}
256+
257+ env :
258+ RUSTFLAGS : -D warnings -Z wasi-exec-model=reactor
259+
217260 steps :
218261 - uses : actions/checkout@v2
219262
263+ - name : Update Rust
264+ run : |
265+ rustup toolchain install nightly --component clippy --component rustfmt
266+ rustup +nightly target add wasm32-wasi
267+ rustup default nightly
268+
269+ - name : Change crate type from library to binary
270+ run : |
271+ grep -v '^\[lib\]' Cargo.toml > Cargo.tmp
272+ grep -v '^crate-type' Cargo.tmp > Cargo.toml
273+ mv src/lib.rs src/main.rs
274+
275+ - name : Build (wasm32-wasi)
276+ run : cargo build --release --target=wasm32-wasi
277+
278+ - name : Clippy (wasm32-wasi)
279+ run : cargo clippy --release --target=wasm32-wasi
280+
281+ - name : Format (rustfmt)
282+ run : cargo fmt -- --check
283+
284+ - name : Format (manifest)
285+ run : cargo verify-project
286+
220287 - name : Run cargo audit
288+ run : cargo audit
289+
290+ - name : Run cargo outdated
291+ run : cargo outdated --root-deps-only --exit-code 1
292+
293+ - name : Rename .wasm to match expected filename
221294 run : |
222- cp -p bazel/cargo/Cargo.raze.lock .
223- cargo audit --ignore RUSTSEC-2020-0159
295+ cd target/wasm32-wasi/release
296+ for file in $(ls -1 *.wasm); do \
297+ mv $file $(echo $file | sed 's/-/_/g'); \
298+ done
299+
300+ - name : Validate Envoy config
301+ run : |
302+ docker run --rm \
303+ -v $(pwd)/envoy.yaml:/envoy.yaml \
304+ -v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \
305+ envoyproxy/envoy:v1.24-latest \
306+ --mode validate \
307+ -c envoy.yaml
0 commit comments