File tree 5 files changed +417
-0
lines changed
5 files changed +417
-0
lines changed Original file line number Diff line number Diff line change
1
+ [target .wasm32-unknown-unknown ]
2
+ runner = " wasm-bindgen-test-runner"
3
+ rustflags = [' --cfg' , ' getrandom_backend="wasm_js"' ]
Original file line number Diff line number Diff line change @@ -147,6 +147,40 @@ jobs:
147
147
env :
148
148
RUST_LOG : ${{ runner.debug && 'TRACE' || 'DEBUG' }}
149
149
150
+ wasm_test :
151
+ name : Build & test wasm32 for browsers
152
+ runs-on : ubuntu-latest
153
+ steps :
154
+ - name : Checkout sources
155
+ uses : actions/checkout@v4
156
+
157
+ - name : Install stable toolchain
158
+ uses : dtolnay/rust-toolchain@stable
159
+
160
+ - name : Add wasm target
161
+ run : rustup target add wasm32-unknown-unknown
162
+
163
+ - name : Install cargo-binstall
164
+ uses : cargo-bins/cargo-binstall@main
165
+
166
+ - name : Install wasm-bindgen-test-runner
167
+ run : cargo binstall wasm-bindgen-cli --locked --no-confirm
168
+
169
+ - name : Install wasm-tools
170
+ uses : bytecodealliance/actions/wasm-tools/setup@v1
171
+
172
+ - name : wasm32 build (netwatch)
173
+ run : cargo build --target wasm32-unknown-unknown -p netwatch
174
+
175
+ # If the Wasm file contains any 'import "env"' declarations, then
176
+ # some non-Wasm-compatible code made it into the final code.
177
+ - name : Ensure no 'import "env"' in netwatch Wasm
178
+ run : |
179
+ ! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/netwatch.wasm | grep 'import "env"'
180
+
181
+ - name : Run smoke test in wasm
182
+ run : cargo test -p netwatch --test smoke --target=wasm32-unknown-unknown
183
+
150
184
check_semver :
151
185
runs-on : ubuntu-latest
152
186
env :
You can’t perform that action at this time.
0 commit comments