forked from naturalatlas/node-gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
67 lines (59 loc) · 3.16 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
language: cpp
compiler:
- gcc
os:
- linux
- osx
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- libc6-dev # for libiconv which is needed by libgdal
env:
matrix:
- NODE_NVM_VERSION="6" TARGET=STATIC
- NODE_NVM_VERSION="6" TARGET=SHARED
- NODE_NVM_VERSION="5" TARGET=STATIC
- NODE_NVM_VERSION="5" TARGET=SHARED
- NODE_NVM_VERSION="4" TARGET=STATIC
- NODE_NVM_VERSION="4" TARGET=SHARED
- NODE_NVM_VERSION="0.10" TARGET=STATIC
- NODE_NVM_VERSION="0.10" TARGET=SHARED
- NODE_NVM_VERSION="5" TARGET=TRUNK
global:
- secure: M1x63eUh8DT4hDLUYzN6kmIHogLbrUp0j1wjLD3h7fQZTRaFZWShJ3HtHnmpFWZ/6ucrJAxnV4Tw6NUiXRp268WXqF9pWpeOEr8UyLJXpV/h4QW0c7eU55C1/L7rE8OqaZT2KnjnCKSjRqAYGbPcZ/BJQFNCy/xnbdjLPnMTeqY=
- secure: REiXQBC1h0krjRn4z57AcQnA2TPISUmzTZGiu4Go8fAmDtvcbQhr0TIMKn/gFd1QCzyJQTQoZObdC+e9fK2EWdLTxUH/LVxgE+jg89i2HrnH9ydvGog3QNQwM52m9i36N9huUPz6m4aCQIHw9/zA+lgTAB0Lmzo4iZmRWVc9Ih4=
matrix:
allow_failures:
- env: NODE_NVM_VERSION="5" TARGET=TRUNK
before_install:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
- PUBLISH_BINARY=false
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE" && test "${TRAVIS_BRANCH}" == "master" && test "${TRAVIS_PULL_REQUEST}" == "false"; then PUBLISH_BINARY=true; fi;
- REPUBLISH_BINARY=false
- if test "${COMMIT_MESSAGE#*'[republish binary]'}" != "$COMMIT_MESSAGE" && test "${TRAVIS_BRANCH}" == "master" && test "${TRAVIS_PULL_REQUEST}" == "false"; then REPUBLISH_BINARY=true; fi;
- git clone https://github.com/creationix/nvm.git ../.nvm && source ../.nvm/nvm.sh
- nvm install $NODE_NVM_VERSION
- nvm use $NODE_NVM_VERSION
- node --version
- npm --version
- $CXX --version
- NPM_CACHE=$(npm config get cache)
- echo $NPM_CACHE
- if [ -d $NPM_CACHE ]; then sudo chown -R $USER $NPM_CACHE; fi;
install:
- if [[ "${TARGET}" == "TRUNK" ]]; then ./scripts/gdal-trunk.sh; fi;
- if [[ "${TARGET}" == "SHARED" && "$(uname -s)" == "Linux" ]]; then sudo apt-get -qq update; sudo apt-get --force-yes -qq install libgdal-dev libgdal1-dev libgdal1h=1.10.0-1~precise1; fi;
- if [[ "${TARGET}" == "SHARED" && "$(uname -s)" == "Darwin" ]]; then brew uninstall gdal; brew install gdal; fi;
- if [[ "${TARGET}" == "SHARED" || "${TARGET}" == "TRUNK" ]]; then npm install --build-from-source --shared_gdal; fi;
- if [[ "${TARGET}" == "SHARED" || "${TARGET}" == "TRUNK" ]]; then gdal-config --version --version; fi;
- if [[ "${TARGET}" == "STATIC" ]]; then npm install --build-from-source > /dev/null; fi;
- npm test
script:
- ./node_modules/.bin/node-pre-gyp package testpackage
- npm test
- if [[ "${TARGET}" == "STATIC" && "${PUBLISH_BINARY}" == "true" ]]; then ./node_modules/.bin/node-pre-gyp publish; rm -rf {build,lib/binding}; ./node_modules/.bin/node-pre-gyp install --fallback-to-build=false; npm test; fi
- if [[ "${TARGET}" == "STATIC" && "${REPUBLISH_BINARY}" == "true" ]]; then ./node_modules/.bin/node-pre-gyp unpublish publish; rm -rf {build,lib/binding}; ./node_modules/.bin/node-pre-gyp install --fallback-to-build=false; npm test; fi