File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99jobs :
1010 tests :
11- runs-on : ubuntu-latest
11+ runs-on : " ${{ matrix.platform.os }}-latest"
12+ strategy :
13+ matrix :
14+ platform : [
15+ { os: "windows", target: "x86_64-pc-windows-msvc" },
16+ { os: "ubuntu", target: "x86_64-unknown-linux-gnu" },
17+ { os: "ubuntu", target: "wasm32-unknown-unknown" },
18+ ]
1219 steps :
1320 - uses : actions/checkout@v2
1421 - name : Cache .cargo and target
@@ -23,15 +30,23 @@ jobs:
2330 uses : actions-rs/toolchain@v1
2431 with :
2532 toolchain : stable
33+ target : ${{ matrix.platform.target }}
2634 profile : minimal
2735 default : true
36+ - name : Install test runner for wasm
37+ if : matrix.platform.target == 'wasm32-unknown-unknown'
38+ run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
2839 - name : Stable Build
2940 uses : actions-rs/cargo@v1
3041 with :
3142 command : build
32- args : --all-features
43+ args : --all-features --target ${{ matrix.platform.target }}
3344 - name : Tests
45+ if : matrix.platform.target != 'wasm32-unknown-unknown'
3446 uses : actions-rs/cargo@v1
3547 with :
3648 command : test
3749 args : --all-features
50+ - name : Tests in WASM
51+ if : matrix.platform.target == 'wasm32-unknown-unknown'
52+ run : wasm-pack test --node -- --all-features
Original file line number Diff line number Diff line change @@ -8,3 +8,6 @@ edition = "2018"
88
99[dependencies ]
1010thiserror = " 1.0.24"
11+
12+ [target .'cfg(target_arch = "wasm32")' .dev-dependencies ]
13+ wasm-bindgen-test = " 0.3"
You can’t perform that action at this time.
0 commit comments