| 1 |
# Setting Up Continuous Integration with `wasm-bindgen-test` |
| 2 |
|
| 3 |
This page contains example configurations for running `wasm-bindgen-test`-based |
| 4 |
tests in various CI services. |
| 5 |
|
| 6 |
Is your favorite CI service missing? [Send us a pull |
| 7 |
request!](https://github.com/rustwasm/wasm-bindgen) |
| 8 |
|
| 9 |
## Travis CI |
| 10 |
|
| 11 |
```yaml |
| 12 |
language: rust |
| 13 |
rust : nightly |
| 14 |
|
| 15 |
addons: |
| 16 |
firefox: latest |
| 17 |
chrome : stable |
| 18 |
|
| 19 |
install: |
| 20 |
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh |
| 21 |
|
| 22 |
script: |
| 23 |
|
| 24 |
# this will test the non wasm targets if your crate has those, otherwise remove this line. |
| 25 |
# |
| 26 |
- cargo test |
| 27 |
|
| 28 |
- wasm-pack test --firefox --headless |
| 29 |
- wasm-pack test --chrome --headless |
| 30 |
``` |
| 31 |
|
| 32 |
## AppVeyor |
| 33 |
|
| 34 |
```yaml |
| 35 |
install: |
| 36 |
- ps: Install-Product node 10 |
| 37 |
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe |
| 38 |
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly |
| 39 |
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin |
| 40 |
- rustc -V |
| 41 |
- cargo -V |
| 42 |
- rustup target add wasm32-unknown-unknown |
| 43 |
- cargo install wasm-bindgen-cli |
| 44 |
|
| 45 |
build: false |
| 46 |
|
| 47 |
test_script: |
| 48 |
# Test in Chrome. chromedriver is installed by default in appveyor. |
| 49 |
- set CHROMEDRIVER=C:\Tools\WebDriver\chromedriver.exe |
| 50 |
- cargo test --target wasm32-unknown-unknown |
| 51 |
- set CHROMEDRIVER= |
| 52 |
# Test in Firefox. geckodriver is also installed by default. |
| 53 |
- set GECKODRIVER=C:\Tools\WebDriver\geckodriver.exe |
| 54 |
- cargo test --target wasm32-unknown-unknown |
| 55 |
``` |
| 56 |
|
| 57 |
## GitHub Actions |
| 58 |
|
| 59 |
```yaml |
| 60 |
on: [push, pull_request] |
| 61 |
|
| 62 |
jobs: |
| 63 |
test: |
| 64 |
runs-on: ubuntu-latest |
| 65 |
steps: |
| 66 |
- uses: actions/checkout@v2 |
| 67 |
|
| 68 |
- name: Install |
| 69 |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh |
| 70 |
|
| 71 |
- run: cargo test |
| 72 |
- run: wasm-pack test --headless --chrome |
| 73 |
- run: wasm-pack test --headless --firefox |
| 74 |
``` |