forked from addaleax/lzma-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
61 lines (61 loc) · 2.53 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
language: c++
compiler:
- clang
- gcc
env:
- TRAVIS_NODE_VERSION="4"
- TRAVIS_NODE_VERSION="5"
- TRAVIS_NODE_VERSION="6"
- TRAVIS_NODE_VERSION="7"
os:
- linux
- osx
matrix:
fast_finish: true
sudo: false
cache:
directories:
- node_modules
- $HOME/.npm
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
before_install:
- echo "$TRAVIS_NODE_VERSION"
- export "PATH=./node_modules/.bin:$PWD/node_modules/.bin:$HOME/.local/bin:$PATH"
- openssl aes-256-cbc -K $encrypted_5d419efedfca_key -iv $encrypted_5d419efedfca_iv -in .travis.id_rsa.enc -out .travis.id_rsa -d
- chmod 0600 .travis.id_rsa
# dummy 7z because npm wants to run the prepublish script
- mkdir -p $HOME/.local/bin/ && touch $HOME/.local/bin/7z && chmod +x $HOME/.local/bin/7z
# coveralls
- pip install --user cpp-coveralls coveralls-merge
# compilers
- if [ "$CXX" = "g++" -a "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="g++-4.9" CC="gcc-4.9" AR="gcc-ar-4.9" RANLIB="gcc-ranlib-4.9" NM="gcc-nm-4.9" ; fi
- if [ "$CXX" = "clang++" ]; then export NPMOPT=--clang=1 ; fi
# node versions
- rm -rf ~/.nvm
- git clone --branch v0.33.1 https://github.com/creationix/nvm.git ~/.nvm
- source ~/.nvm/nvm.sh
- nvm install "$TRAVIS_NODE_VERSION"
- node --version
# no coverage for tags (they are release builds!)
- if [ -z "$TRAVIS_TAG" ]; then export DO_COVERAGE=1; fi
- if [ -n "$TRAVIS_TAG" ]; then export CFLAGS="$CFLAGS -O3" LDFLAGS="$LDFLAGS"; fi
- if [ -n "$DO_COVERAGE" ]; then export LDFLAGS="$LDFLAGS --coverage" CFLAGS="$CFLAGS --coverage"; fi
- echo "CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\""
- npm install [email protected]
install:
- npm install $NPMOPT --build-from-source --verbose
script:
- node --expose-gc ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec -s 1000 -t 5000
- npm run jshint
after_success:
- if [ -n "$DO_COVERAGE" ]; then cpp-coveralls --gcov-options '\-lp' --build-root build --exclude build/liblzma --exclude node_modules --dump coverage/cppfiles.json; fi
- if [ -n "$DO_COVERAGE" ]; then coveralls --stdout < coverage/lcov.info > coverage/jsfiles.json; fi
- if [ -n "$DO_COVERAGE" ]; then coveralls-merge coverage/jsfiles.json coverage/cppfiles.json; fi
# publish for node-pre-gyp
- node-pre-gyp package
- if [ -n "$TRAVIS_TAG" -a $CXX = "g++-4.9" ]; then echo 'put build/stage/lzma-native/* uploads/lzma-native/' |sftp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -b- -i .travis.id_rsa [email protected]; fi