forked from naturalatlas/node-gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
103 lines (97 loc) · 3.77 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
language: cpp
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- libc6-dev # for libiconv which is needed by libgdal
matrix:
include:
- os: osx
env: NODE_NVM_VERSION="10" TARGET=STATIC
- os: linux
dist: precise
env: NODE_NVM_VERSION="10" TARGET=STATIC
- os: osx
env: NODE_NVM_VERSION="10" TARGET=SHARED
- os: linux
dist: trusty
env: NODE_NVM_VERSION="10" TARGET=SHARED
- os: osx
env: NODE_NVM_VERSION="10" TARGET=TRUNK
- os: linux
dist: trusty
env: NODE_NVM_VERSION="10" TARGET=TRUNK
- os: osx
env: NODE_NVM_VERSION="9" TARGET=STATIC
- os: linux
dist: precise
env: NODE_NVM_VERSION="9" TARGET=STATIC
- os: osx
env: NODE_NVM_VERSION="9" TARGET=SHARED
- os: linux
dist: trusty
env: NODE_NVM_VERSION="9" TARGET=SHARED
- os: osx
env: NODE_NVM_VERSION="8" TARGET=STATIC
- os: linux
dist: precise
env: NODE_NVM_VERSION="8" TARGET=STATIC
- os: osx
env: NODE_NVM_VERSION="8" TARGET=SHARED
- os: linux
dist: trusty
env: NODE_NVM_VERSION="8" TARGET=SHARED
- os: osx
env: NODE_NVM_VERSION="6" TARGET=STATIC
- os: linux
dist: precise
env: NODE_NVM_VERSION="6" TARGET=STATIC
- os: osx
env: NODE_NVM_VERSION="6" TARGET=SHARED
- os: linux
dist: trusty
env: NODE_NVM_VERSION="6" TARGET=SHARED
- os: osx
env: NODE_NVM_VERSION="4" TARGET=STATIC
- os: linux
dist: precise
env: NODE_NVM_VERSION="4" TARGET=STATIC
- os: osx
env: NODE_NVM_VERSION="4" TARGET=SHARED
- os: linux
dist: trusty
env: NODE_NVM_VERSION="4" TARGET=SHARED
allow_failures:
- env: NODE_NVM_VERSION="10" 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 libc6-dev; 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