<commit_before>sudo: false
language: cpp

# don't re-build for tags so that [publish binary] is not re-run
# https://github.com/travis-ci/travis-ci/issues/1532
branches:
  except:
    - /^v[0-9]/

os:
- linux
- osx

env:
  matrix:
  - TRAVIS_NODE_VERSION="4"
  - TRAVIS_NODE_VERSION="4" ARCH="x86"
  - TRAVIS_NODE_VERSION="5"
  - TRAVIS_NODE_VERSION="5" ARCH="x86"
  - TRAVIS_NODE_VERSION="6"
  - TRAVIS_NODE_VERSION="6" ARCH="x86"

matrix:
  exclude:
  - os: osx
    env: TRAVIS_NODE_VERSION="4" ARCH="x86"
  - os: osx
    env: TRAVIS_NODE_VERSION="5" ARCH="x86"
  - os: osx
    env: TRAVIS_NODE_VERSION="6" ARCH="x86"

addons:
  apt:
    sources:
     - george-edison55-precise-backports # cmake 3
     - ubuntu-toolchain-r-test # gcc
    packages:
     - g++-4.8
     - g++-4.8-multilib
     - gcc-multilib
     - cmake
     - cmake-data

before_install:
# purge possible previous boost installation
- rm -rf ~/.cmake-js

# reinstall nvm
- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm && source ~/.nvm/nvm.sh
- nvm install $TRAVIS_NODE_VERSION
- nvm use $TRAVIS_NODE_VERSION

# setup files for download
- BASE_URL=$(node -p "'https://nodejs.org/dist/' + process.version")
- X86_FILE=$(node -p "'node-' + process.version + '-' + process.platform + '-x86'")
# download node if testing x86 architecture
- if [[ "$ARCH" == "x86" ]]; then wget $BASE_URL/$X86_FILE.tar.gz; tar -xf $X86_FILE.tar.gz; export PATH=$X86_FILE/bin:$PATH; fi

# explore current stack
- uname -a
- file `which node`
- node --version
- node -p 'process.platform + "@" + process.arch'
- npm --version

# use g++-4.8 on linux
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
- $CXX --version

# install recent cmake for osx
- if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then wget --no-check-certificate http://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.tar.gz  ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then tar -xzf cmake-3.4.3-Darwin-x86_64.tar.gz                                                 ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then export PATH=$PWD/cmake-3.4.3-Darwin-x86_64/CMake.app/Contents/bin:$PATH                   ;fi

# figure out if we should publish
- PUBLISH_BINARY=false
# if we are building a tag then publish
- echo $TRAVIS_BRANCH
- echo `git describe --tags --always HEAD`
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi;
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY

# Cleanup the output of npm
- npm config set progress false
- npm config set spin false


install:
# try to fix boost cmake issue - try git version
- npm install cmake-js/boost-lib
#- patch -p0 < boostlib.patch

# ensure source install works
- npm install --build-from-source

script:
# if publishing, do it
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package; fi;
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp-github publish --release; fi;

# cleanup
- node-pre-gyp clean

# test binary exists
- if [[ $PUBLISH_BINARY == true ]]; then npm install --fallback-to-build=false; fi;<commit_msg>Print failed logs<commit_after>sudo: false
language: cpp

# don't re-build for tags so that [publish binary] is not re-run
# https://github.com/travis-ci/travis-ci/issues/1532
branches:
  except:
    - /^v[0-9]/

os:
- linux
- osx

env:
  matrix:
  - TRAVIS_NODE_VERSION="4"
  - TRAVIS_NODE_VERSION="4" ARCH="x86"
  - TRAVIS_NODE_VERSION="5"
  - TRAVIS_NODE_VERSION="5" ARCH="x86"
  - TRAVIS_NODE_VERSION="6"
  - TRAVIS_NODE_VERSION="6" ARCH="x86"

matrix:
  exclude:
  - os: osx
    env: TRAVIS_NODE_VERSION="4" ARCH="x86"
  - os: osx
    env: TRAVIS_NODE_VERSION="5" ARCH="x86"
  - os: osx
    env: TRAVIS_NODE_VERSION="6" ARCH="x86"

addons:
  apt:
    sources:
     - george-edison55-precise-backports # cmake 3
     - ubuntu-toolchain-r-test # gcc
    packages:
     - g++-4.8
     - g++-4.8-multilib
     - gcc-multilib
     - cmake
     - cmake-data

before_install:
# purge possible previous boost installation
- rm -rf ~/.cmake-js

# reinstall nvm
- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm && source ~/.nvm/nvm.sh
- nvm install $TRAVIS_NODE_VERSION
- nvm use $TRAVIS_NODE_VERSION

# setup files for download
- BASE_URL=$(node -p "'https://nodejs.org/dist/' + process.version")
- X86_FILE=$(node -p "'node-' + process.version + '-' + process.platform + '-x86'")
# download node if testing x86 architecture
- if [[ "$ARCH" == "x86" ]]; then wget $BASE_URL/$X86_FILE.tar.gz; tar -xf $X86_FILE.tar.gz; export PATH=$X86_FILE/bin:$PATH; fi

# explore current stack
- uname -a
- file `which node`
- node --version
- node -p 'process.platform + "@" + process.arch'
- npm --version

# use g++-4.8 on linux
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
- $CXX --version

# install recent cmake for osx
- if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then wget --no-check-certificate http://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.tar.gz  ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then tar -xzf cmake-3.4.3-Darwin-x86_64.tar.gz                                                 ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then export PATH=$PWD/cmake-3.4.3-Darwin-x86_64/CMake.app/Contents/bin:$PATH                   ;fi

# figure out if we should publish
- PUBLISH_BINARY=false
# if we are building a tag then publish
- echo $TRAVIS_BRANCH
- echo `git describe --tags --always HEAD`
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi;
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY

# Cleanup the output of npm
- npm config set progress false
- npm config set spin false


install:
# try to fix boost cmake issue - try git version
- npm install cmake-js/boost-lib
#- patch -p0 < boostlib.patch

# ensure source install works
- npm install --build-from-source
- echo "LOGS: "
- cat /home/travis/build/lyssdod/node-libtorrent/build/boost-1.61.0/boost_chrono_jam-build-*.log

script:
# if publishing, do it
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package; fi;
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp-github publish --release; fi;

# cleanup
- node-pre-gyp clean

# test binary exists
- if [[ $PUBLISH_BINARY == true ]]; then npm install --fallback-to-build=false; fi;
{'fraction_non_alphanumeric': 0.1567977261961156, 'fraction_numerical': 0.024948681509553133, 'mean_word_length': 2.9911783238815377, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '43245', 'n_tokens_mistral': 2550, 'n_tokens_neox': 2388, 'n_words': 591}