File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-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 1111env :
1212 CARGO_INCREMENTAL : 0
1313 RUSTFLAGS : " -Dwarnings"
14+ EMSDK_VERSION : 1.39.20 # Last emsdk compatible with Rust's LLVM 11
1415
1516jobs :
1617 check-doc :
@@ -125,7 +126,6 @@ jobs:
125126 override : true
126127 - run : cargo test --features=std
127128
128- # TODO: Add emscripten when it's working with Cross
129129 cross-tests :
130130 name : Cross Test
131131 runs-on : ubuntu-latest
@@ -224,6 +224,38 @@ jobs:
224224 mv /tmp/wasmtime ~/.cargo/bin
225225 - run : cargo test --target wasm32-wasi
226226
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+
227259 build :
228260 name : Build only
229261 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments