-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (62 loc) · 1.7 KB
/
build-wasm.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
name: Wasm
on:
workflow_call:
workflow_dispatch:
pull_request:
paths:
- "wasm/**"
- "proto/**"
- ".github/workflows/*wasm*"
- "devops/**"
push:
branches:
- main
paths:
- "wasm/**"
- "proto/**"
- ".github/workflows/*wasm*"
- "devops/**"
jobs:
build_test:
name: Build, Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ] # windows-latest has issues with wasm-pack.exe
node-version: [ 14, 16, 18 ]
target: [ 'node', 'browser' ]
defaults:
run:
working-directory: ./wasm
steps:
- uses: actions/checkout@v3
- name: Setup protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: jetli/[email protected]
with:
version: 'latest'
- uses: actions/setup-node@v3
name: Setup Node v${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
- run: |
rustup toolchain uninstall stable
rustup toolchain install stable
rustup toolchain install stable --target wasm32-unknown-unknown
- run: |
npm install
npm run build:proto
npm run build:wasm:${{ matrix.target }}
npm run test:${{ matrix.target }}
shell: pwsh
working-directory: ./wasm/packages/okapi
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
directory: ./wasm/packages/okapi
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.target == 'node' }}