File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 33runner = 'wasm-bindgen-test-runner'
44[target.wasm32-wasi]
55runner = '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:
125125 override : true
126126 - run : cargo test --features=std
127127
128- # TODO: Add emscripten when it's working with Cross
129128 cross-tests :
130129 name : Cross Test
131130 runs-on : ubuntu-latest
@@ -224,6 +223,40 @@ jobs:
224223 mv /tmp/wasmtime ~/.cargo/bin
225224 - run : cargo test --target wasm32-wasi
226225
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+
227260 build :
228261 name : Build only
229262 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments