forked from Kitt-AI/snowboy
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
92 lines (83 loc) · 4.02 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
84
85
86
87
88
89
90
91
92
language: cpp
# Cache node dependencies
cache:
directories:
- node_modules
# Ubuntu 14.04 Trusty support
sudo: required
dist: trusty
addons:
apt:
sources:
# add PPAs with more up-to-date toolchains
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
packages:
# install toolchains
- libmagic-dev
- libatlas-base-dev
- gcc-5
- g++-5
- clang-3.8
os:
- linux
- osx
env:
global:
- secure: "Sco6ZpLZnyGuXvfoe1MCKrTi9HVXOZxsdy5DGbrzanEshGv8tG74QqjJGp6llHkJ5AgXWsS9wa8nn/YLG45UwbfmYy43dn12v3vYsd3/GgnEejWANIIDW1ujKwXnGRc5hTuxtUYnZ25AlzD845Pig3GqR1wqwqUtxa+V+PkyqIbvYp3pM08Wca+q6LkquvA3bgpMq7mpXcF07CSSCwbDGdU2DUS0Kvsbm0zrXGan7zjlmcJYnmyqAITb8ST5Rut9Pge5zwdwcKShiLox0wfIGe6vNlT6XEwHWiH+uAmz/VB6RaNmxC955oTAbsDR/U/cY3J2BSlXs2lJKJwg7NgpCNgMBZnYX4p9+xtZOCfOK2ZypcHkB2u81gppdM3EUG4aVjar+KY1IIdH4vo95xDkkP1yjs9zJlqESCcMvxTNezdIf4Lxy0gMQa7iVGpZweXHHfBLDF85nes9OUrreES8QLe155Yg+pWlnJrpzOtIbCcx3IkuKkFoFLei/byR8vuBrYL1oSTcVB24c0QCGcUv8+0/n/M4wlqQal9eeUe7Zt7/3zwUmQCUJNpjJZJsB4UFSkvOBq2wv8VGYJOxfLU0oPvtMIHg2XW3blXVdshKS9I2DttUXkJ9Vu6hrHIVV32jV1nAXp8tCwf0HujqrPiYOsTUDErZi9aUt/Y5A2QDIEU="
- secure: "WVxarvBkWwLxbmDJGpi0NQnVIDVyw5ebM3y2/XvSM0jJ7sgDUQTO4FBgezjIqnXN2KNFEn90ceVrcgRxXriNUGbqooPzAV6n60xgR858D+NyYQLHMwj4ivu8m4jpVEykP4NPIp49u/d1Ii47Wo/INB3KtU7/TskeHBdweJCQrZD3eib6jyDzfZeVXS0cQiowuMPO8RNqTpM00VWTW8dNxoFq6wmrEBSNZVXCfMzLCA/7XjqumTPGR1moJDPKkkCm+evpE0/3e4g47sUYsNHx9IBa2hAZmOg+app6MVboN3Zbi4SjEc1e3oalIJ/aEKfUKVuSCwydqNkmwLRCB4w6bE9LYn3v1RKDBpdVSVSu2mjrrKKJGT8KZKwLGs0WsfAz5vRIf1uF0eqG79EZdOTuVdMyNcy0G7ZD9EyZunC7hb2ojnl65qhdIEEq9nkoNhTFPI1hp2saCbb0h9bDCfCps183ZU3CMiDfbeft10GRBBeHDKnf2V+UJ+QUcL3GEK3U94tJu4iKSUi8JJGD+cv7YObRyMDO6GWYUuKlosqL8LJU+EWqmD9dqw40Z5GuxbIEs/hKgiLIi1ssmslCQMcuI1SPwyijbI4wPVYDGpwZ4s01sVdwWF4YzWYhjBrebnAEvhN8IBWL3oMXJh0M/icTRSToebUDggTWCr5HaLgXQZ4="
matrix:
- NODE_VERSION="6"
- NODE_VERSION="7"
- NODE_VERSION="8"
- NODE_VERSION="9"
- NODE_VERSION="10"
- NODE_VERSION="10"
- NODE_VERSION="11"
- NODE_VERSION="12"
before_install:
# use the correct version of node
- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
- source ~/.nvm/nvm.sh
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put local node-pre-gyp on PATH
- export PATH=./node_modules/.bin/:$PATH
# put global node-gyp and nan on PATH
- npm install node-gyp -g
# install aws-sdk so it is available for publishing
- npm install aws-sdk nan typescript @types/node
# figure out if we should publish or republish
- PUBLISH_BINARY=false
- REPUBLISH_BINARY=false
# if we are building a tag then publish
# - if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi;
# or if we put [publish binary] in the commit message
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi;
# alternativly we can [republish binary] which will replace any existing binary
- if test "${COMMIT_MESSAGE#*'[republish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true && REPUBLISH_BINARY=true; fi;
install:
# ensure source install works
- npm install --build-from-source
# test our module
- node lib/node/index.js
before_script:
# if publishing, do it
- if [[ $REPUBLISH_BINARY == true ]]; then node-pre-gyp package unpublish; fi;
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package publish; fi;
# cleanup
- node-pre-gyp clean
- node-gyp clean
script:
# if publishing, test installing from remote
- INSTALL_RESULT=0
- if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi;
# if install returned non zero (errored) then we first unpublish and then call false so travis will bail at this line
- if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";node-pre-gyp unpublish;false; fi
# If success then we arrive here so lets clean up
- node-pre-gyp clean
after_success:
# if success then query and display all published binaries
- node-pre-gyp info