-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
174 lines (164 loc) · 5.52 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Much of this is borrowed from node-sqlite3 and node-icu-bidi
sudo: false
language: cpp
git:
depth: 10
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
packages:
- clang-3.5
- gcc-5-multilib
- g++-5-multilib
- linux-libc-dev:i386
- libxml2-dev:i386
- zlib1g-dev:i386
## don't re-build for tags so that [publish binary] is not re-run
## https://github.com/travis-ci/travis-ci/issues/1532
#branches:
# except:
# - /^[0-9]+[.][0-9]+[.][0-9]+/
matrix:
include:
# Linux
- os: linux
compiler: clang
env: NODE_VERSION="5.0.0" PUBLISHABLE=false
- os: linux
env: NODE_VERSION="5.0.0" BUILD_X86=true # node abi 47
# Test in release mode, not just debug mode.
- os: linux
compiler: clang
env: NODE_VERSION="5.0.0" PUBLISHABLE=false RELEASE=true
# - os: linux
# compiler: clang
# env: NODE_VERSION="4.2.1" PUBLISHABLE=false
- os: linux
env: NODE_VERSION="4.2.1" BUILD_X86=true # node abi 46
# - os: linux
# compiler: clang
# env: NODE_VERSION="iojs-v3.3.1" PUBLISHABLE=false
- os: linux
env: NODE_VERSION="iojs-v3.3.1" BUILD_X86=true # node abi 45
# - os: linux
# compiler: clang
# env: NODE_VERSION="iojs-v2.4.0" PUBLISHABLE=false
- os: linux
env: NODE_VERSION="iojs-v2.4.0" BUILD_X86=true # node abi 44
# disabled because libphp5-embed package is not on whitelist yet
# https://github.com/travis-ci/apt-package-whitelist#package-approval-process
# # test building against external libphp5
# - os: linux
# env: NODE_VERSION="4.2.1" EXTERNAL_LIBPHP=true PUBLISHABLE=false
# addons:
# apt:
# sources: [ 'libphp5-embed:i386', 'php5-dev:i386' ]
# packages: [ 'libphp5-embed', 'php5-dev']
# OS X
- os: osx
compiler: clang
env: NODE_VERSION="5.0.0" # node abi 47
# Test in release mode, not just debug mode.
- os: osx
compiler: clang
env: NODE_VERSION="5.0.0" PUBLISHABLE=false RELEASE=true
- os: osx
compiler: clang
env: NODE_VERSION="4.2.1" # node abi 46
- os: osx
compiler: clang
env: NODE_VERSION="iojs-v3.3.1" # node abi 45
- os: osx
compiler: clang
env: NODE_VERSION="iojs-v2.4.0" # node abi 44
before_install:
- export PUBLISHABLE=${PUBLISHABLE:-true}
- export RELEASE=${RELEASE:-false}
# ensure that published builds are not built in debug mode
- if test "$PUBLISHABLE" = "true" ; then if scripts/validate_tag.sh --check ; then RELEASE=true ; fi ; fi
- if test "$TRAVIS_OS_NAME $CC" = "linux gcc" ; then
export CXX="g++-5" ;
export CC="gcc-5" ;
fi
- if test "$TRAVIS_OS_NAME $CC" = "linux clang" ; then
export CXX="clang++-3.5" ;
export CC="clang-3.5" ;
fi
- if test "$TRAVIS_OS_NAME $CC" = "osx clang" ; then
export MACOSX_DEPLOYMENT_TARGET=10.7 ;
fi
# we need to install libicu on os x
- |
if test "$TRAVIS_OS_NAME" = "osx"; then
brew update | head ;
brew install icu4c ;
fi
# check if tag exists and matches package.json
- scripts/validate_tag.sh
- echo $NODE_VERSION
- 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
- if test "$NODE_VERSION" = "0.8.28" ; then npm install -g [email protected] ; fi
# Work around ECONNRESET issues on travis:
# https://github.com/npm/npm/issues/7558#issuecomment-97528256
# https://github.com/npm/npm/issues/7699#issuecomment-93091111
- npm install -g npm@latest
- npm config set spin=false
#- npm config set loglevel=http
- node --version
- npm --version
install:
# put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH
before_script:
# get commit message
- export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
script:
- node --version
- npm --version
- DEBUG=''
- if test "$RELEASE" = "false"; then DEBUG='--debug --libicu=external' ; fi
- if false ; then export V=1 ; fi # Useful when debugging build/link failures.
- if test -z "$EXTERNAL_LIBPHP" ; then npm install --build-from-source $DEBUG; else npm install --build-from-source --libphp5=external $DEBUG; fi
- node-pre-gyp package testpackage
# OSX malloc debugging
- |
if test "$TRAVIS_OS_NAME" = "osx"; then
echo DISABLED export MallocStackLogging=1
echo DISABLED export MallocStackLoggingNoCompact=1
export MallocScribble=1
export MallocPreScribble=1
export MallocGuardEdges=1
export MallocCheckHeapStart=1
export MallocCheckHeapEach=1
export DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib
fi
- |
if npm test ; then
echo "Test successful. Publishable=$PUBLISHABLE"
else
echo "Test failed, refusing to publish."
PUBLISHABLE=false
false
fi
- |
if test "$TRAVIS_OS_NAME" = "osx"; then
unset MallocStackLogging
unset MallocStackLoggingNoCompact
unset MallocScribble
unset MallocPreScribble
unset MallocGuardEdges
unset MallocCheckHeapStart
unset MallocCheckHeapEach
unset DYLD_INSERT_LIBRARIES
fi
- export PUBLISH=false
# Normal case: tagged builds trigger 32-bit and 64-bit x86 builds
- if scripts/validate_tag.sh --check ; then PUBLISH=true; fi
# Workaround to trigger a manual x86 build
- if test "$TRAVIS_BRANCH" == "x86" -a "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH=true; fi
- if test "$PUBLISH,$PUBLISHABLE" = "true,true"; then npm install [email protected] && npm install [email protected] && npm run gh-publish && if test -n "$BUILD_X86"; then scripts/publish_x86.sh ; fi ; fi