File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
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
+ ]
12
19
steps :
13
20
- uses : actions/checkout@v2
14
21
- name : Cache .cargo and target
@@ -23,15 +30,23 @@ jobs:
23
30
uses : actions-rs/toolchain@v1
24
31
with :
25
32
toolchain : stable
33
+ target : ${{ matrix.platform.target }}
26
34
profile : minimal
27
35
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
28
39
- name : Stable Build
29
40
uses : actions-rs/cargo@v1
30
41
with :
31
42
command : build
32
- args : --all-features
43
+ args : --all-features --target ${{ matrix.platform.target }}
33
44
- name : Tests
45
+ if : matrix.platform.target != 'wasm32-unknown-unknown'
34
46
uses : actions-rs/cargo@v1
35
47
with :
36
48
command : test
37
49
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"
8
8
9
9
[dependencies ]
10
10
thiserror = " 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