File tree 2 files changed +38
-1
lines changed
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 3
3
runner = 'wasm-bindgen-test-runner'
4
4
[target.wasm32-wasi]
5
5
runner = 'wasmtime'
6
+
7
+ # Just run on node by default (that's where emscripten is tested)
8
+ [target.'cfg(target_os = "emscripten")']
9
+ runner = 'node'
Original file line number Diff line number Diff line change @@ -125,7 +125,6 @@ jobs:
125
125
override : true
126
126
- run : cargo test --features=std
127
127
128
- # TODO: Add emscripten when it's working with Cross
129
128
cross-tests :
130
129
name : Cross Test
131
130
runs-on : ubuntu-latest
@@ -224,6 +223,40 @@ jobs:
224
223
mv /tmp/wasmtime ~/.cargo/bin
225
224
- run : cargo test --target wasm32-wasi
226
225
226
+ emscripten-tests :
227
+ name : Emscripten tests
228
+ runs-on : ubuntu-latest
229
+ env :
230
+ EMSDK_VERSION : 1.39.20 # Last emsdk compatible with Rust's LLVM 11
231
+ steps :
232
+ - uses : actions/checkout@v2
233
+ - uses : actions-rs/toolchain@v1
234
+ with :
235
+ profile : minimal
236
+ toolchain : stable
237
+ - run : rustup target add wasm32-unknown-emscripten
238
+ - run : rustup target add asmjs-unknown-emscripten
239
+ - name : Cache emsdk
240
+ id : cache-emsdk
241
+ uses : actions/cache@v2
242
+ with :
243
+ path : ~/emsdk
244
+ key : ${{ runner.os }}-${{ env.EMSDK_VERSION }}-emsdk
245
+ - name : Install emsdk
246
+ if : steps.cache-emsdk.outputs.cache-hit != 'true'
247
+ run : |
248
+ git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
249
+ cd ~/emsdk
250
+ ./emsdk install $EMSDK_VERSION
251
+ ./emsdk activate $EMSDK_VERSION
252
+ - run : echo "$HOME/emsdk/upstream/emscripten" >> $GITHUB_PATH
253
+ - name : wasm test
254
+ run : cargo test --target=wasm32-unknown-emscripten --features=std
255
+ - name : asm.js test
256
+ run : | # Debug info breaks on asm.js
257
+ RUSTFLAGS="$RUSTFLAGS -C debuginfo=0"
258
+ cargo test --target=asmjs-unknown-emscripten --features=std
259
+
227
260
build :
228
261
name : Build only
229
262
runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments