forked from peterbraden/node-opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·86 lines (74 loc) · 3.19 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
language: node_js
os:
- linux
# - osx
matrix:
allow_failures:
- os: osx
node_js:
- '6'
- '7'
sudo: required
services:
- docker
compiler: clang
env:
global:
- secure: "kCAwXdfcMv4l4ok5lO89ANbKXXwWQpn5/3qupSbhmX2NDIGUxyXze/cs90u9gF5hcT7ebq27ZJPEtu7pRov8MadfQM9BAd4ZZrHcMHWSkA0Iz+nM+m0Urwach6jkp2Iuwx15L2NHSis7f5PUKJcEv4Gnqs8jrCJzHHS7m7dO0Xo="
- secure: "lBIk4BhdIkSmJtFUNp93UjDm445i9eF7nKA+oSiLRu+b9i/WeRLiKFI89tehexWeXBlyNhziBN16LrHmx3I86yZfEok9dBMA1JuzYBjrvpjRAflGcqaCFLV3axyyyNQRIh7Q+ziAlg0xg8HL752BpnfXO91g3jfDPjGxcvBb5xQ="
before_install:
# Fix a problem with apt-get failing later, see http://docs.travis-ci.com/user/installing-dependencies/#Installing-Ubuntu-packages
- sudo apt-get update -qq
- sudo add-apt-repository -y ppa:kubuntu-ppa/backports
- sudo apt-get update
- sudo apt-get install --force-yes --yes libcv-dev libcvaux-dev libhighgui-dev libopencv-dev
# for code coverage
- sudo apt-get install lcov
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put local node-pre-gyp on PATH
- export PATH=./node_modules/.bin/:$PATH
# install node-pre-gyp so it is available for packaging and publishing
- npm install node-gyp -g
# install node-pre-gyp so it is available for packaging and publishing
- npm install node-pre-gyp
# install aws-sdk so it is available for publishing to AS3
- npm install aws-sdk
# figure out if we should publish
- PUBLISH_BINARY=false
# if we are building a tag then publish
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi;
# or if we put [publish binary] in the commit message
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi;
- platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
install:
# install dependencies first
- npm install
# build from source, run test and generate code coverage
- make cover
- NODE_OPENCV_DEBUG=true node lib/opencv.js
- docker build -t peterbraden/node-opencv-ubuntu-14-04 -f test/Dockerfile-ubuntu-14-04 .
before_script:
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY
# if publishing, do it
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package publish || true; fi;
# cleanup
- node-pre-gyp clean
- node-gyp clean
- sudo apt-get purge --yes libcv-dev
- sudo apt-get purge --yes libopencv-dev
- sudo apt-get purge --yes libhighgui-dev
script:
# if publishing, test installing from remote
- INSTALL_RESULT=0
- if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi;
# 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
# Can't compile opencv 32bit in 64 bit env.
after_success:
# if success then query and display all published binaries
- node-pre-gyp info
# Upload coverage to codecov
- bash <(curl -s https://codecov.io/bash) -s coverage -f *.info