-
Notifications
You must be signed in to change notification settings - Fork 15
76 lines (71 loc) · 2.1 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: test
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [12.x, 14.x]
name: ${{ matrix.os }}-${{ matrix.node-version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
# Caching
- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
- uses: bahmutov/[email protected]
- name: Transpile JavaScript
run: yarn run transpile
- name: Build node release
run: yarn run build:node-release
- name: Run node tests
run: yarn run test:node
- name: Run rust tests
run: cargo test --all-features
test-wasm:
name: wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# Caching
- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-14.x
- uses: bahmutov/[email protected]
- name: Transpile JavaScript
run: yarn run transpile
- name: Build wasm release
run: yarn run build:wasm-node-release
- name: Run wasm tests
run: yarn run test:wasm