Commit 11b4a620 by Dane Springmeyer

Merge pull request #313 from mapbox/travis-refactor

support node-webkit 0.10.0-rc1 with refactored Travis CI builds
parents cb835651 ab3e07c2
language: cpp
# http://docs.travis-ci.com/user/multi-os/
os:
- linux
- osx
env:
matrix:
- export NODE_VERSION="0.8"
- export NODE_VERSION="0.10" NODE_WEBKIT="0.8.6"
- export NODE_VERSION="0.11"
- NODE_VERSION="0.8"
- NODE_VERSION="0.10"
- NODE_VERSION="0.11"
- NODE_WEBKIT="0.8.6"
- NODE_WEBKIT="0.10.0-rc1"
global:
- secure: QhuP5E/kYL1j1KDkHGJtk6DSJr1RH4DR/JrC62Viuf5Du8jE+i0kPWfF2MxtuEmKo35orhpu8t8mzKygWfuO63WPuuIE9qd/+V/y99Lqcj0tEN6wJ5RnywktbTJWg23zphjhmYq3Xj8DLVEikCZBwHtlbygkO9Q60cn1PK+bnPg=
- secure: HxCS2dQAWI0KmCFnFNNZoucG4FeAW+itG7+Hp0dNtwmxZzGOZYFO2bZcGvTAMNfVN++oqLxTebYQI1oB5yUl5mPJjrjthaGS6Zq3S6rfJcXiv+icYgEXlR6ejQ97dsHw1Jeg8nedCQlI4kHfvG6pgBLhq9hnugxH1Cjhdt14E9U=
......@@ -12,110 +19,15 @@ env:
before_install:
# check if tag exists and matches package.json
- scripts/validate_tag.sh
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH
- echo $NODE_VERSION
- git clone https://github.com/creationix/nvm.git ../.nvm
- source ../.nvm/nvm.sh
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- node --version
- npm --version
- platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
install:
# test installing from source
- npm install --build-from-source
- npm test
# put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH
before_script:
# test publishing
- PUBLISH_BINARY=false
# check if this is a git tag built statically to be portable
#- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi;
# or check if we are manually requesting binary publishing via a commit keyword
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi;
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi
# for testing node-webkit, launch a virtual display
- if [ "$NODE_WEBKIT" != "" ]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start +extension RANDR; fi
# note: `sleep 3` gives xvfb some time to start
# get commit message
- export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
script:
# test install from published binary
- make clean
- npm install
- npm test
- make clean
# test source compile against system libsqlite3
- if [[ "$platform" == 'linux' ]]; then sudo apt-get -qq update; sudo apt-get -qq install libsqlite3-dev; fi
- make clean
- npm install --build-from-source --sqlite=/usr
- npm test
# on Linux 64 bit: install nw-gyp if NODE_WEBKIT is not empty
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then npm install nw-gyp -g; fi; fi
# on Linux 64 bit: rebuild node-sqlite3 for 64 bit node-webkit target (if NODE_WEBKIT is not empty)
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp rebuild --runtime=node-webkit --target=$NODE_WEBKIT; fi; fi
# on Linux 64 bit: download and unpack node-webkit, add it to PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-x64.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then tar xf node-webkit-v${NODE_WEBKIT}-linux-x64.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then prenwpath="$PATH"; export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-x64:$PATH; fi; fi
# on Linux 64 bit: ldd nw
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then ldd $(pwd)/node-webkit-v${NODE_WEBKIT}-linux-x64/nw; fi; fi
# on Linux 64 bit: attempt node-pre-gyp package testpackage (if NODE_WEBKIT is not empty)
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp package testpackage --runtime=node-webkit --target=$NODE_WEBKIT --overwrite; fi; fi
# on Linux 64 bit: erase used node-webkit, restore PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then export PATH="$prenwpath"; rm -rf node-webkit-v${NODE_WEBKIT}-linux-x64; fi; fi
- make clean
# 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
- NVER=`node -v`
- wget http://nodejs.org/dist/${NVER}/node-${NVER}-${platform}-x86.tar.gz
- tar xf node-${NVER}-${platform}-x86.tar.gz
# enable 32 bit node
- export PATH=$(pwd)/node-${NVER}-${platform}-x86/bin:$PATH
# install 32 bit compiler toolchain and X11
- if [[ "$platform" == 'linux' ]]; then sudo apt-get -y install gcc-multilib g++-multilib; fi
# test source compile in 32 bit mode with internal libsqlite3
- if [[ "$platform" == 'linux' ]]; then CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source; else npm install --build-from-source; fi
- npm test
# publish 32 bit build
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi;
# install nw-gyp in 32 bit environment if NODE_WEBKIT is not empty (but on Linux it's installed earlier on 64 bit)
- if [ "$platform" != 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then npm install nw-gyp -g; fi; fi
# rebuild node-sqlite3 for 32 bit node-webkit target (if NODE_WEBKIT is not empty)
- if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp rebuild --runtime=node-webkit --target=$NODE_WEBKIT; fi;
# on Linux 32 bit: install 32 bit stuff necessary for node-webkit 32 bit
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libx11-6:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libglib2.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libgtk2.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libatk1.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libgdk-pixbuf2.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libcairo2:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libfreetype6:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libfontconfig1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxcomposite1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libasound2:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxdamage1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxext6:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxfixes3:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libnss3:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libnspr4:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libgconf-2-4:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libexpat1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libdbus-1-3:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libudev0:i386; fi; fi
# on Linux 32 bit: download and unpack node-webkit, add it to PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then tar xf node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then prenwpath="$PATH"; export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32:$PATH; fi; fi
# on Linux 32 bit: ldd nw
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then ldd $(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32/nw; fi; fi
# attempt node-pre-gyp package testpackage (if NODE_WEBKIT is not empty)
- if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp package testpackage --runtime=node-webkit --target=$NODE_WEBKIT --overwrite; fi;
# on Linux 32 bit: erase used node-webkit, restore PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then export PATH="$prenwpath"; rm -rf node-webkit-v${NODE_WEBKIT}-linux-ia32; fi; fi
- make clean
# test source compile in 32 bit mode against external libsqlite3
- if [[ "$platform" == 'linux' ]]; then sudo apt-get -y install libsqlite3-dev:i386; CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source --sqlite=/usr; npm test; fi
- if [[ "${NODE_VERSION}" ]]; then ./scripts/build_against_node.sh; fi;
- if [[ "${NODE_WEBKIT}" ]]; then ./scripts/build_against_node_webkit.sh; fi;
......@@ -4,7 +4,7 @@ Asynchronous, non-blocking [SQLite3](http://sqlite.org/) bindings for [Node.js](
[![Build Status](https://travis-ci.org/mapbox/node-sqlite3.svg?branch=master)](https://travis-ci.org/mapbox/node-sqlite3)
[![Build status](https://ci.appveyor.com/api/projects/status/d5dfp6cmo5fmh2a8/branch/master)](https://ci.appveyor.com/project/springmeyer/node-sqlite3)
[![Build status](https://ci.appveyor.com/api/projects/status/gvm7ul0hpmdawqom)](https://ci.appveyor.com/project/Mapbox/node-sqlite3)
## Supported platforms
......
environment:
node_pre_gyp_accessKeyId:
secure: 9JxHOXxgQ7UaXFCQh4ihEBDElQgE4l0XareRstBCpLk=
node_pre_gyp_secretAccessKey:
secure: s1us6xb8U2EqlaVYtoVMtulfgMdX4VVEKgTF+Eft104gWja1GG0Blf6cMJtG7Yu3
matrix:
- nodejs_version: 0.10
- nodejs_version: 0.11
......
......@@ -36,9 +36,8 @@
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"node-pre-gyp": "0.5.13",
"nan": "1.1.2",
"node-pre-gyp": "0.5.18",
"node-pre-gyp": "0.5.19",
"set-immediate": "0.1.1"
},
"bundledDependencies": [
......@@ -46,7 +45,7 @@
],
"devDependencies": {
"mocha": "1.x",
"aws-sdk": "~2.0.0-rc.19"
"aws-sdk": "~2.0.4"
},
"engines": {
"node": ">= 0.8.0 < 0.13.0"
......
#!/usr/bin/env bash
set -u -e
function publish() {
if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then
node-pre-gyp publish
node-pre-gyp info
node-pre-gyp 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
}
if [[ ! -d ../.nvm ]]; then
git clone https://github.com/creationix/nvm.git ../.nvm
fi
set +u
source ../.nvm/nvm.sh
nvm install $NODE_VERSION
nvm use $NODE_VERSION
set -u
node --version
npm --version
# test installing from source
npm install --build-from-source
node-pre-gyp package testpackage
npm test
publish
# now test building against shared sqlite
if [[ $(uname -s) == 'Darwin' ]]; then
brew install sqlite
npm install --build-from-source --sqlite=$(brew --prefix)
else
sudo apt-get -qq update
sudo apt-get -qq install libsqlite3-dev
npm install --build-from-source --sqlite=/usr
fi
npm test
platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
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
# so here we use the 32 bit ones to also test 32 bit builds
NVER=`node -v`
wget http://nodejs.org/dist/${NVER}/node-${NVER}-${platform}-x86.tar.gz
tar xf node-${NVER}-${platform}-x86.tar.gz
# enable 32 bit node
export PATH=$(pwd)/node-${NVER}-${platform}-x86/bin:$PATH
# install 32 bit compiler toolchain and X11
# test source compile in 32 bit mode with internal libsqlite3
CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source
node-pre-gyp package testpackage
npm test
publish
make clean
# 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
npm test
fi
#!/usr/bin/env bash
set -u -e
if [[ ! -d ../.nvm ]]; then
git clone https://github.com/creationix/nvm.git ../.nvm
fi
set +u
source ../.nvm/nvm.sh
nvm install 0.10
nvm use 0.10
set -u
node --version
npm --version
npm install nw-gyp
OLD_PATH="$PATH"
GYP_ARGS="--runtime=node-webkit --target=$NODE_WEBKIT"
if [[ $(uname -s) == 'Darwin' ]]; then
GYP_ARGS="${GYP_ARGS} --target_arch=ia32"
fi
if [[ $(uname -s) == 'Darwin' ]]; then
export NW_DOWNLOAD=node-webkit-v${NODE_WEBKIT}-osx-ia32
wget http://dl.node-webkit.org/v${NODE_WEBKIT}/${NW_DOWNLOAD}.zip
unzip -q ${NW_DOWNLOAD}.zip
export PATH=$(pwd)/node-webkit.app/Contents/MacOS/:${PATH}
# v0.10.0-rc1 unzips with extra folder
export PATH=$(pwd)/${NW_DOWNLOAD}/node-webkit.app/Contents/MacOS/:${PATH}
else
export NW_DOWNLOAD=node-webkit-v${NODE_WEBKIT}-linux-x64
# for testing node-webkit, launch a virtual display
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start +extension RANDR
wget http://dl.node-webkit.org/v${NODE_WEBKIT}/${NW_DOWNLOAD}.tar.gz
tar xf ${NW_DOWNLOAD}.tar.gz
export PATH=$(pwd)/${NW_DOWNLOAD}:${PATH}
fi
npm install --build-from-source ${GYP_ARGS}
# test the package
node-pre-gyp package testpackage ${GYP_ARGS}
PUBLISH_BINARY=false
if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then
node-pre-gyp publish ${GYP_ARGS}
node-pre-gyp info ${GYP_ARGS}
node-pre-gyp clean ${GYP_ARGS}
make clean
# now install from binary
INSTALL_RESULT=$(npm install ${GYP_ARGS} --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 ${GYP_ARGS};false; fi
# If success then we arrive here so lets clean up
node-pre-gyp clean ${GYP_ARGS}
fi
# restore PATH
export PATH="$OLD_PATH"
rm -rf ${NW_DOWNLOAD}
# TODO linux 32 bit
: '
# rebuild node-sqlite3 for 32 bit node-webkit target (if NODE_WEBKIT is not empty)
node-pre-gyp rebuild ${GYP_ARGS}
# on Linux 32 bit: install 32 bit stuff necessary for node-webkit 32 bit
sudo apt-get -y install libx11-6:i386
sudo apt-get -y install libxtst6:i386
sudo apt-get -y install libcap2:i386
sudo apt-get -y install libglib2.0-0:i386
sudo apt-get -y install libgtk2.0-0:i386
sudo apt-get -y install libatk1.0-0:i386
sudo apt-get -y install libgdk-pixbuf2.0-0:i386
sudo apt-get -y install libcairo2:i386
sudo apt-get -y install libfreetype6:i386
sudo apt-get -y install libfontconfig1:i386
sudo apt-get -y install libxcomposite1:i386
sudo apt-get -y install libasound2:i386
sudo apt-get -y install libxdamage1:i386
sudo apt-get -y install libxext6:i386
sudo apt-get -y install libxfixes3:i386
sudo apt-get -y install libnss3:i386
sudo apt-get -y install libnspr4:i386
sudo apt-get -y install libgconf-2-4:i386
sudo apt-get -y install libexpat1:i386
sudo apt-get -y install libdbus-1-3:i386
sudo apt-get -y install libudev0:i386
# on Linux 32 bit: download and unpack node-webkit, add it to PATH
wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz
tar xf node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz
OLD_PATH="$PATH";
export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32:$PATH
# on Linux 32 bit: ldd nw
ldd $(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32/nw
# attempt node-pre-gyp package testpackage (if NODE_WEBKIT is not empty)
node-pre-gyp package testpackage publish ${GYP_ARGS}
# on Linux 32 bit: erase used node-webkit, restore PATH
export PATH="$OLD_PATH"; rm -rf node-webkit-v${NODE_WEBKIT}-linux-ia32
'
\ No newline at end of file
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