-
Notifications
You must be signed in to change notification settings - Fork 4
90 lines (75 loc) · 2.77 KB
/
test.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Test Vault
on: [push, pull_request]
jobs:
build-native:
name: Native (${{ matrix.os }}, ${{ matrix.node }})
strategy:
matrix:
node: ["electron", "node"]
os: [ "windows-latest", "macos-latest", "ubuntu-latest" ]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "18.x"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install LLVM (windows)
run: choco install -y llvm
if: runner.os == 'Windows'
- name: Install system libs (not windows)
run: sudo apt-get install libusb-1.0-0-dev libudev-dev
if: runner.os == 'Linux'
- name: Install build tools (windows)
run: choco install -y visualcpp-build-tools
if: runner.os == 'Windows'
- name: Install JS dependencies
run: yarn install
- name: Build Rust lib (windows)
run: yarn workspace @emeraldpay/emerald-vault-native run build:rs:${{ matrix.node }}
if: runner.os == 'Windows'
env:
# dynamic linkage may be a problem for Windows users who would need to install some extra DLLs just to make Emerald works
# so better to link them statically.
RUSTFLAGS: "-C target-feature=+crt-static"
RUST_BACKTRACE: "1"
- name: Build Rust lib (not windows)
run: yarn workspace @emeraldpay/emerald-vault-native run build:rs:${{ matrix.node }}
if: runner.os != 'Windows'
env:
RUST_BACKTRACE: "1"
# support macOS High Sierra
MACOSX_DEPLOYMENT_TARGET: "10.13"
- name: Show lib details
run: |
node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp reveal --directory packages/native
ls packages/native/native
- name: Build Typescript
run: yarn workspaces run build:ts
- name: Test
run: yarn workspace @emeraldpay/emerald-vault-native run test:${{ matrix.node }}
- name: Clean Before Package
run: yarn workspace @emeraldpay/emerald-vault-native run clean:rs
if: matrix.node == 'electron'
- name: Package
run: yarn workspace @emeraldpay/emerald-vault-native run package:${{ matrix.node }}
build-core:
name: Core
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "18.x"
- run: yarn install
- run: yarn workspace @emeraldpay/emerald-vault-core run build:ts
- name: Test
run: yarn workspace @emeraldpay/emerald-vault-core run test