File tree 2 files changed +37
-1
lines changed
2 files changed +37
-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 11
11
env :
12
12
CARGO_INCREMENTAL : 0
13
13
RUSTFLAGS : " -Dwarnings"
14
+ EMSDK_VERSION : 1.39.20 # Last emsdk compatible with Rust's LLVM 11
14
15
15
16
jobs :
16
17
check-doc :
@@ -125,7 +126,6 @@ jobs:
125
126
override : true
126
127
- run : cargo test --features=std
127
128
128
- # TODO: Add emscripten when it's working with Cross
129
129
cross-tests :
130
130
name : Cross Test
131
131
runs-on : ubuntu-latest
@@ -224,6 +224,38 @@ jobs:
224
224
mv /tmp/wasmtime ~/.cargo/bin
225
225
- run : cargo test --target wasm32-wasi
226
226
227
+ emscripten-tests :
228
+ name : Emscripten tests
229
+ runs-on : ubuntu-latest
230
+ steps :
231
+ - uses : actions/checkout@v2
232
+ - uses : actions-rs/toolchain@v1
233
+ with :
234
+ profile : minimal
235
+ toolchain : stable
236
+ - run : rustup target add wasm32-unknown-emscripten
237
+ - run : rustup target add asmjs-unknown-emscripten
238
+ - name : Cache emsdk
239
+ id : cache-emsdk
240
+ uses : actions/cache@v2
241
+ with :
242
+ path : ~/emsdk
243
+ key : ${{ runner.os }}-${{ env.EMSDK_VERSION }}-emsdk
244
+ - name : Install emsdk
245
+ if : steps.cache-emsdk.outputs.cache-hit != 'true'
246
+ run : |
247
+ git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
248
+ cd ~/emsdk
249
+ ./emsdk install $EMSDK_VERSION
250
+ ./emsdk activate $EMSDK_VERSION
251
+ - run : echo "$HOME/emsdk/upstream/emscripten" >> $GITHUB_PATH
252
+ - name : wasm test
253
+ run : cargo test --target=wasm32-unknown-emscripten --features=std
254
+ - name : asm.js test
255
+ run : | # Debug information doesn't work with asm.js
256
+ RUSTFLAGS="$RUSTFLAGS -C debuginfo=0"
257
+ cargo test --target=asmjs-unknown-emscripten --features=std
258
+
227
259
build :
228
260
name : Build only
229
261
runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments