forked from serialport/node-serialport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
84 lines (73 loc) · 1.98 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
72
73
74
75
76
77
78
79
80
81
82
83
---
notifications:
email: false
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- g++-4.8-multilib
- gcc-multilib
# Build matrix
os:
- linux
- osx
env:
global:
- secure: "L+AGMJc5NAsuym+xzB4FWj0c2rCobosixkoxLBhDBVkLiYsMtfS9y1w8Xz0pbWKJnJAH9tfwHluu5aX2qYk2HbreSyNzy8hbPW+9RbSyAQexeiZG4mLuDEz0xvlpCCQBsS1OfMypQk0/JvL4oA9B/xasrpkeVuPI7dwAz2WcFms="
matrix:
- BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8"
- BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8" ARCH="x86"
- TRAVIS_NODE_VERSION="10"
- TRAVIS_NODE_VERSION="12"
matrix:
exclude:
- os: osx
env: TRAVIS_NODE_VERSION="6" ARCH="x86"
- os: osx
env: BINARY_BUILDER="true" TRAVIS_NODE_VERSION="8" ARCH="x86"
- os: osx
env: TRAVIS_NODE_VERSION="9" ARCH="x86"
before_install:
# download node if testing x86 architecture
- nvm install $TRAVIS_NODE_VERSION
- >
if [[ "$ARCH" == "x86" ]]; then
BASE_URL=$(node -p "'https://nodejs.org/dist/' + process.version");
X86_FILE=$(node -p "'node-' + process.version + '-' + process.platform + '-x86'");
wget $BASE_URL/$X86_FILE.tar.gz;
tar -xf $X86_FILE.tar.gz;
nvm deactivate;
export PATH=`pwd`/$X86_FILE/bin:$PATH;
fi;
# use g++-4.8 on Linux
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
- $CXX --version
# print versions
- uname -a
- which node; file `which node`
- node --version
- node -p 'process.platform + "@" + process.arch'
- npm --version
# figure out if we should publish
- PUBLISH_BINARY=false
- echo $TRAVIS_BRANCH
- echo `git describe --tags --always HEAD`
- if [[ $(git tag --points-at HEAD) =~ $TRAVIS_BRANCH ]]; then PUBLISH_BINARY=$BINARY_BUILDER; fi;
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY
install:
- npm install
- npm run rebuild
script:
- npm run lint
- npm test
# if publishing, do it
- >
if [[ $PUBLISH_BINARY == true ]]; then
echo "building and uploading binaries"
npm run prebuild;
fi;
after_success:
- npm run coverage