77
77
export PATH=$PATH:$(go env GOPATH)/bin
78
78
buildifier -mode=check WORKSPACE
79
79
buildifier -mode=check BUILD
80
- buildifier -mode=check examples/BUILD
81
80
82
81
- name : Format (cargo raze)
83
82
run : |
89
88
stable :
90
89
runs-on : ubuntu-latest
91
90
91
+ env :
92
+ RUSTFLAGS : -D warnings
93
+
92
94
steps :
93
95
- uses : actions/checkout@v2
94
96
@@ -99,23 +101,15 @@ jobs:
99
101
rustup target add wasm32-wasi
100
102
101
103
- name : Build (wasm32-unknown-unknown)
102
- env :
103
- RUSTFLAGS : -D warnings
104
104
run : cargo build --release --all-targets --target=wasm32-unknown-unknown
105
105
106
106
- name : Clippy (wasm32-unknown-unknown)
107
- env :
108
- RUSTFLAGS : -D warnings
109
107
run : cargo clippy --release --all-targets --target=wasm32-unknown-unknown
110
108
111
109
- name : Build (wasm32-wasi)
112
- env :
113
- RUSTFLAGS : -D warnings
114
110
run : cargo build --release --all-targets --target=wasm32-wasi
115
111
116
112
- name : Clippy (wasm32-wasi)
117
- env :
118
- RUSTFLAGS : -D warnings
119
113
run : cargo clippy --release --all-targets --target=wasm32-wasi
120
114
121
115
- name : Format (rustfmt)
@@ -133,6 +127,9 @@ jobs:
133
127
nightly :
134
128
runs-on : ubuntu-latest
135
129
130
+ env :
131
+ RUSTFLAGS : -D warnings
132
+
136
133
steps :
137
134
- uses : actions/checkout@v2
138
135
@@ -144,23 +141,15 @@ jobs:
144
141
rustup default nightly
145
142
146
143
- name : Build (wasm32-unknown-unknown)
147
- env :
148
- RUSTFLAGS : -D warnings
149
144
run : cargo build --release --all-targets --target=wasm32-unknown-unknown
150
145
151
146
- name : Clippy (wasm32-unknown-unknown)
152
- env :
153
- RUSTFLAGS : -D warnings
154
147
run : cargo clippy --release --all-targets --target=wasm32-unknown-unknown
155
148
156
149
- name : Build (wasm32-wasi)
157
- env :
158
- RUSTFLAGS : -D warnings
159
150
run : cargo build --release --all-targets --target=wasm32-wasi
160
151
161
152
- name : Clippy (wasm32-wasi)
162
- env :
163
- RUSTFLAGS : -D warnings
164
153
run : cargo clippy --release --all-targets --target=wasm32-wasi
165
154
166
155
- name : Format (rustfmt)
@@ -175,49 +164,144 @@ jobs:
175
164
- name : Package (publish)
176
165
run : cargo publish --dry-run --target=wasm32-unknown-unknown
177
166
178
- reactor :
167
+ outdated :
179
168
runs-on : ubuntu-latest
180
169
181
170
steps :
182
171
- uses : actions/checkout@v2
183
172
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
185
183
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
189
186
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
191
210
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
194
213
195
214
- 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
199
216
200
217
- 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
204
219
205
- outdated :
206
- runs-on : ubuntu-latest
220
+ - name : Format (rustfmt)
221
+ run : cargo fmt -- --check
207
222
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
210
228
211
229
- name : Run cargo outdated
212
230
run : cargo outdated --root-deps-only --exit-code 1
213
231
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 :
215
242
runs-on : ubuntu-latest
216
243
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
+
217
260
steps :
218
261
- uses : actions/checkout@v2
219
262
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
+
220
287
- 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
221
294
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