Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travis: Fix wasm32 CI #141

Merged
merged 1 commit into from
Apr 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ jobs:
- name: "Linux, beta"
rust: beta

- name: "WASM via emscripten, stdweb, wasm-bindgen and WASI"
rust: nightly
- name: "WASM via stdweb, wasm-bindgen and WASI"
rust: stable
addons:
firefox: latest
chrome: stable
install:
- rustup target add wasm32-unknown-unknown
- rustup target add wasm32-unknown-emscripten
- rustup target add asmjs-unknown-emscripten
- rustup target add wasm32-wasi
# Get latest geckodriver
- export VERSION=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r ".tag_name")
Expand All @@ -66,15 +64,7 @@ jobs:
- tar -xzf wasm-bindgen.tar.gz --strip-components=1
# Place the runner binaries in our PATH
- mv cargo-web wasmtime wasm-bindgen-test-runner $HOME/.cargo/bin
# Download and setup emscripten
- cargo web prepare-emscripten
env: EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0"
script:
# We cannot run emscripten test binaries (see rust-lang/rust#63649).
# However, we can still build and link all tests to make sure that works.
# This is actually useful as it finds stuff such as rust-random/rand#669
- cargo web test --target wasm32-unknown-emscripten --no-run
- cargo web test --target asmjs-unknown-emscripten --no-run
- cargo test --target wasm32-wasi
# stdweb (wasm32-unknown-unknown) tests (Node, Chrome)
- cargo web test --package stdweb-getrandom
Expand All @@ -89,6 +79,25 @@ jobs:
cargo test --package wasm-bindgen-getrandom
--target wasm32-unknown-unknown --test web

- name: "WASM via Emscripten"
rust: stable
env:
- CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node
- CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node
install:
- rustup target add wasm32-unknown-emscripten
- rustup target add asmjs-unknown-emscripten
- export VERSION=1.39.13 # Pin version for stability
- git clone https://github.com/emscripten-core/emsdk.git
- ./emsdk/emsdk install $VERSION
- ./emsdk/emsdk activate $VERSION
- source ./emsdk/emsdk_env.sh
script:
- cargo test --target wasm32-unknown-emscripten
# Prevent 'wasm2js does not support source maps yet' error.
- RUSTFLAGS='-C debuginfo=0' cargo test --target asmjs-unknown-emscripten


- &nightly_and_docs
name: "Linux, nightly, docs"
rust: nightly
Expand Down