-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
71 lines (57 loc) · 2.46 KB
/
.travis.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
os:
- osx
- linux
- windows
language: node_js
node_js:
- 12
cache:
directories:
- $HOME/.cargo
- $TRAVIS_BUILD_DIR/native/target
- $TRAVIS_BUILD_DIR/node_modules
addons:
apt:
packages:
- libusb-1.0-0-dev
env:
global:
- PATH="$HOME/.cargo/bin:$PATH"
- RUSTFLAGS="-C target-feature=+crt-static"
- RUST_BACKTRACE=1
- YARN_GPG=no # otherwise Yarn starts a GPG daemon which prevents builds from finishing on Windows
matrix:
- NODE_RUNTIME=electron
- NODE_RUNTIME=node
before_install:
# Install Rust and Cargo
- curl https://sh.rustup.rs -sSf > /tmp/rustup.sh
- sh /tmp/rustup.sh -y
- if [[ ${TRAVIS_OS_NAME} == "windows" ]]; then rustup toolchain install stable-msvc && rustup target install x86_64-pc-windows-msvc && rustup set default-host x86_64-pc-windows-msvc; fi
# Show details about current system
- rustup show
- node -v
- npm -v
install:
- yarn install
script:
# Build Rust
- if [[ ${NODE_RUNTIME} == "node" ]]; then yarn workspace @emeraldpay/emerald-vault-native run build:rs; fi;
- if [[ ${NODE_RUNTIME} == "electron" ]]; then yarn workspace @emeraldpay/emerald-vault-native run build:rs:electron; fi;
# Show details about node module
- node-pre-gyp reveal --directory packages/native
# Build Typescript
- yarn workspaces run build:ts;
# Run tests
- yarn workspace @emeraldpay/emerald-vault-core run test;
- if [[ ${NODE_RUNTIME} == "node" ]]; then yarn workspace @emeraldpay/emerald-vault-native run test; fi;
## electron needs directx lib (dxva2.dll) which is missing on travis windows
- if [[ ${NODE_RUNTIME} == "electron" && "$TRAVIS_OS_NAME" != "windows" ]]; then yarn workspace @emeraldpay/emerald-vault-native run test:electron; fi;
# Cleanup to avoid putting temp files into resulting package
- if [[ ${NODE_RUNTIME} == "electron" ]]; then yarn workspace @emeraldpay/emerald-vault-native run clean:rs; fi;
# Package for pre-gyp
- if [[ ${NODE_RUNTIME} == "node" ]]; then yarn workspace @emeraldpay/emerald-vault-native run package:node; fi;
- if [[ ${NODE_RUNTIME} == "electron" ]]; then yarn workspace @emeraldpay/emerald-vault-native run package:electron; fi;
# Publish when using 'publish binary' keywords
- COMMIT_MESSAGE=$(git log --format=%B --no-merges -n 1 | tr -d '\n')
- if [[ ${COMMIT_MESSAGE} =~ "publish binary" ]]; then yarn workspace @emeraldpay/emerald-vault-native run upload-binary || exit 0; fi;