-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
70 lines (63 loc) · 2.29 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
sudo: false
language: node_js
env:
global:
secure: "LKh0Cc14itGFicEVCD+whTswTmI0HzWqy1C3cLw2z16TgST2dtmMdmUFXU1jNATfi0l4qqwrlnIgJrtzFNrc5fwxMY7XYr71F9QjfWIY7hfrTh3iZBYZJdlUdx0zClwGsN06ldDiaxKKljf/OmXuu5tds5iyel5O8KKZUaIFzKc="
os:
- windows
- osx
- linux
node_js: [10, 11, 12, 13, 14]
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
osx_image: xcode8
matrix:
exclude:
# until travis.ci resolves problem with "VM fails to come up if you have secrets"
# https://travis-ci.community/t/current-known-issues-please-read-this-before-posting-a-new-topic/264
- os: windows
before_install:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then CXX=g++-4.9; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then CXX=g++; fi # g++ is an alias of clang, so let's use it
# update npm
- |
echo "TRAVIS_NODE_VERSION=$TRAVIS_NODE_VERSION"
if [[ $TRAVIS_NODE_VERSION -le 6 ]]; then NPM_VERSION=3
elif [[ $TRAVIS_NODE_VERSION -le 8 ]]; then NPM_VERSION=4
elif [[ $TRAVIS_NODE_VERSION -le 9 ]]; then NPM_VERSION=5
else NPM_VERSION=6
fi
echo "NPM_VERSION=$NPM_VERSION"
- npm -g install npm@${NPM_VERSION}
# print versions
- node --version
- npm --version
- if [[ $TRAVIS_OS_NAME != "windows" ]]; then $CXX --version; fi
# install windows-build-tools
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then npm install --global --production windows-build-tools; fi
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then setx PYTHON "%USERPROFILE%\.windows-build-tools\python27\python.exe"; fi
# figure out if we should publish
- PUBLISH_BINARY=no
# if we are building a tag then publish
- echo $TRAVIS_BRANCH
- echo `git describe --tags --always HEAD`
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=yes; fi;
- echo "Are we going to publish a binary? ->" $PUBLISH_BINARY
install:
# ensure source install works
- npm install --build-from-source
# compile typescript tests
- npm run tsc
script:
- npm test
# publish on a tag
- if [[ $PUBLISH_BINARY == yes ]]; then node-pre-gyp package; fi;
- if [[ $PUBLISH_BINARY == yes ]]; then node-pre-gyp-github publish --release; fi;
# cleanup
- node-pre-gyp clean
# test binary exists
- if [[ $PUBLISH_BINARY == yes ]]; then npm install --fallback-to-build=false; fi;