Commit cb641b04 by Dane Springmeyer

Merge pull request #505 from mapbox/sudo-false

Add support for travis docker + node 4.x
parents 5a2939d0 1711622e
sudo: false sudo: false
language: cpp language: cpp
git:
depth: 10
addons: addons:
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
packages: packages:
- g++-4.8 - clang-3.5
# http://docs.travis-ci.com/user/multi-os/
os:
- linux
- osx
# don't re-build for tags so that [publish binary] is not re-run # don't re-build for tags so that [publish binary] is not re-run
# https://github.com/travis-ci/travis-ci/issues/1532 # https://github.com/travis-ci/travis-ci/issues/1532
...@@ -18,36 +19,92 @@ branches: ...@@ -18,36 +19,92 @@ branches:
except: except:
- /^v[0-9]/ - /^v[0-9]/
matrix:
include:
# Linux
- os: linux
compiler: clang
env: NODE_VERSION="4.0.0" PUBLISHABLE=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="iojs-3.1.0" PUBLISHABLE=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="iojs-2.4.0" PUBLISHABLE=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="iojs-1.8.4" PUBLISHABLE=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="0.12.7" PUBLISHABLE=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="0.10.40" PUBLISHABLE=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
# test building against external sqlite
- os: linux
compiler: clang
env: NODE_VERSION="0.10.40" EXTERNAL_SQLITE=true
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5','libsqlite3-dev']
# OS X
- os: osx
compiler: clang
env: NODE_VERSION="4.0.0" # node abi 46
- os: osx
compiler: clang
env: NODE_VERSION="iojs-3.1.0" # node abi 46
- os: osx
compiler: clang
env: NODE_VERSION="iojs-2.4.0" # node abi 44
- os: osx
compiler: clang
env: NODE_VERSION="iojs-1.8.4" # node abi 43
- os: osx
compiler: clang
env: NODE_VERSION="0.12.7" # node abi 14
- os: osx
compiler: clang
env: NODE_VERSION="0.10.40" # node abi 11
env: env:
matrix:
- NODE_VERSION="0.10.40" # ABI 11
- NODE_VERSION="0.12.7" # ABI 14
- NODE_VERSION="iojs-1.8.4" # ABI 43
- NODE_VERSION="iojs-2.3.4" # ABI 44
- NODE_VERSION="iojs-3.1.0" # ABI 45
- NODE_WEBKIT="0.8.6" TARGET_ARCH="ia32"
- NODE_WEBKIT="0.8.6" TARGET_ARCH="x64"
- NODE_WEBKIT="0.10.5" TARGET_ARCH="ia32"
- NODE_WEBKIT="0.10.5" TARGET_ARCH="x64"
global: global:
- JOBS: "8"
- secure: PifMOSnn+mWR1RUptXse+fLvWiTrzg0R/mazO7RWhXHWBKv0uAJ/qV3dI0GIRBLtjG10Iy+tT5RNh1TIbBzB9Y67wMcGvylUPG1+3EOKoBMEPnOD9AgCEQw4SOXfGPx0cq2N6ueSKieCgu1yKN9Wq7XCbE+zTk/DiRNIdLirVoo= - secure: PifMOSnn+mWR1RUptXse+fLvWiTrzg0R/mazO7RWhXHWBKv0uAJ/qV3dI0GIRBLtjG10Iy+tT5RNh1TIbBzB9Y67wMcGvylUPG1+3EOKoBMEPnOD9AgCEQw4SOXfGPx0cq2N6ueSKieCgu1yKN9Wq7XCbE+zTk/DiRNIdLirVoo=
- secure: cc4esJY1vPXL31IeumAJoKWDDO2BTGFiltwfO1jbTbiV7QT911QUjTUasxXIVpOaHNCpxSTyevPwwTWfzt2EtF92Lli+qhQ2bbzMiDSBZstSrHdAe62Ai2M1oYYUwk/0cABB/2nO9uRyYwITCxpTSNzZBrYhn3C29WqBhPeVDmM= - secure: cc4esJY1vPXL31IeumAJoKWDDO2BTGFiltwfO1jbTbiV7QT911QUjTUasxXIVpOaHNCpxSTyevPwwTWfzt2EtF92Lli+qhQ2bbzMiDSBZstSrHdAe62Ai2M1oYYUwk/0cABB/2nO9uRyYwITCxpTSNzZBrYhn3C29WqBhPeVDmM=
matrix:
exclude:
- env: NODE_WEBKIT="0.8.6" TARGET_ARCH="x64"
os: osx
before_install: before_install:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi - if [[ $(uname -s) == 'Linux' ]]; then
# check if tag exists and matches package.json export CXX="clang++-3.5";
export CC="clang-3.5";
fi;
- scripts/validate_tag.sh - scripts/validate_tag.sh
- echo $NODE_VERSION - source ./scripts/install_node.sh ${NODE_VERSION}
# upgrade nvm
- node --version
- npm --version
- npm update -g npm
- npm --version
install: install:
# put node-pre-gyp on path # put node-pre-gyp on path
...@@ -59,4 +116,5 @@ before_script: ...@@ -59,4 +116,5 @@ before_script:
script: script:
- if [[ "${NODE_VERSION}" ]]; then ./scripts/build_against_node.sh; fi; - if [[ "${NODE_VERSION}" ]]; then ./scripts/build_against_node.sh; fi;
- if [[ "${NODE_WEBKIT}" ]]; then ./scripts/build_against_node_webkit.sh; fi; # disabled for now: need to port to sudo:false
#- if [[ "${NODE_WEBKIT}" ]]; then ./scripts/build_against_node_webkit.sh; fi;
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
}, },
"dependencies": { "dependencies": {
"nan": "~2.0.5", "nan": "~2.0.5",
"node-pre-gyp": "~0.6.9" "node-pre-gyp": "~0.6.10"
}, },
"bundledDependencies": [ "bundledDependencies": [
"node-pre-gyp" "node-pre-gyp"
......
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ ! -d ../.nvm ]]; then source ~/.nvm/nvm.sh
git clone https://github.com/creationix/nvm.git ../.nvm
fi
source ../.nvm/nvm.sh
nvm install $NODE_VERSION
nvm use $NODE_VERSION
set -u -e set -e -u
function publish() { function publish() {
if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then if [[ ${PUBLISHABLE:-false} == true ]] && [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then
node-pre-gyp package testpackage
node-pre-gyp publish node-pre-gyp publish
node-pre-gyp info node-pre-gyp info
node-pre-gyp clean
make clean make clean
# now install from binary
INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true
# 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
fi fi
} }
# test installing from source # test installing from source
npm install --build-from-source npm install --build-from-source --clang=1
node-pre-gyp package testpackage
npm test npm test
publish publish
...@@ -34,18 +22,16 @@ publish ...@@ -34,18 +22,16 @@ publish
# now test building against shared sqlite # now test building against shared sqlite
if [[ $(uname -s) == 'Darwin' ]]; then if [[ $(uname -s) == 'Darwin' ]]; then
brew install sqlite brew install sqlite
npm install --build-from-source --sqlite=$(brew --prefix) npm install --build-from-source --sqlite=$(brew --prefix) --clang=1
else else
sudo apt-get -qq update npm install --build-from-source --sqlite=/usr --clang=1
sudo apt-get -qq install libsqlite3-dev
npm install --build-from-source --sqlite=/usr
fi fi
npm test npm test
platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/") platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
: '
if [[ $(uname -s) == 'Linux' ]]; then if [[ $(uname -s) == 'Linux' ]]; then
sudo apt-get -y install gcc-multilib g++-multilib
# node v0.8 and above provide pre-built 32 bit and 64 bit binaries # node v0.8 and above provide pre-built 32 bit and 64 bit binaries
# so here we use the 32 bit ones to also test 32 bit builds # so here we use the 32 bit ones to also test 32 bit builds
NVER=`node -v` NVER=`node -v`
...@@ -62,10 +48,12 @@ if [[ $(uname -s) == 'Linux' ]]; then ...@@ -62,10 +48,12 @@ if [[ $(uname -s) == 'Linux' ]]; then
# enable 32 bit node # enable 32 bit node
export PATH=$(pwd)/node-${NVER}-${platform}-x86/bin:$(pwd)/node-${NVER}-${platform}-ia32/bin:$PATH export PATH=$(pwd)/node-${NVER}-${platform}-x86/bin:$(pwd)/node-${NVER}-${platform}-ia32/bin:$PATH
fi fi
node -e "console.log(process.arch,process.execPath)" which node
ls -l $(which node)
#node -e "console.log(process.arch,process.execPath)"
# install 32 bit compiler toolchain and X11 # install 32 bit compiler toolchain and X11
# test source compile in 32 bit mode with internal libsqlite3 # test source compile in 32 bit mode with internal libsqlite3
CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source --clang=1
node-pre-gyp package testpackage node-pre-gyp package testpackage
npm test npm test
publish publish
...@@ -73,8 +61,9 @@ if [[ $(uname -s) == 'Linux' ]]; then ...@@ -73,8 +61,9 @@ if [[ $(uname -s) == 'Linux' ]]; then
# broken for some unknown reason against io.js # broken for some unknown reason against io.js
if [[ ${NODE_VERSION:0:4} != 'iojs' ]]; then if [[ ${NODE_VERSION:0:4} != 'iojs' ]]; then
# test source compile in 32 bit mode against external libsqlite3 # test source compile in 32 bit mode against external libsqlite3
sudo apt-get -y install libsqlite3-dev:i386 CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source --sqlite=/usr --clang=1
CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source --sqlite=/usr
npm test npm test
fi fi
fi fi
'
# here we set up the node version on the fly based on the matrix value.
# This is done manually so that the build works the same on OS X
rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
source ~/.nvm/nvm.sh
nvm install $1
nvm use $1
node --version
npm --version
which node
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment