<commit_before>language: cpp

sudo: false

matrix:
  include:
     # Coverage
     - os: osx
       compiler: clang
       env: NODE_VERSION="1.2.0" COVERAGE=true # node abi 43
     # Linux
     - os: linux
       compiler: clang
       env: NODE_VERSION="1.2.0" # node abi 43
     - os: linux
       compiler: clang
       env: NODE_VERSION="0.12.2" # node abi 14
     - os: linux
       compiler: clang
       env: NODE_VERSION="0.10.38" # node abi 11
     # OS X
     - os: osx
       compiler: clang
       env: NODE_VERSION="1.2.0" # node abi 43
     - os: osx
       compiler: clang
       env: NODE_VERSION="0.12.2" # node abi 14
     - os: osx
       compiler: clang
       env: NODE_VERSION="0.10.38" # node abi 11

env:
  global:
   - JOBS: "8"
   - MAPNIK_GIT: v3.0.0-rc1-1074-g5808b7f
   - secure: <KEY>
   - secure: <KEY>HWikJiLUiZBbLyE=


before_install:
 - export COVERAGE=${COVERAGE:-false}
 - platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
 # upgrade libstdc++ to support C++11
 - if [[ ${platform} == 'linux' ]]; then
       source ./scripts/setup_cpp11_toolchain.sh;
     fi;
 - if [[ ${platform} == 'darwin' ]]; then xcrun --sdk macosx --show-sdk-version; fi;
 # check if tag exists and matches package.json
 - scripts/validate_tag.sh
 - COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
 # put node-pre-gyp on path
 - export PATH=./node_modules/.bin/:$PATH
 # here we set up the node version on the fly based on the matrix value.
 # This is done manually so that it is easy to flip the 'language' to
 # objective-c in another branch (to run the same travis.yml on OS X)
 - git clone https://github.com/creationix/nvm.git ../.nvm
 - source ../.nvm/nvm.sh
 - nvm install $NODE_VERSION
 - nvm use $NODE_VERSION
 - node --version
 - npm --version
 - PUBLISH_BINARY=false
 - REPUBLISH_BINARY=false
 - if [[ ${COVERAGE} == true ]]; then
      brew install pyenv;
      eval "$(pyenv init -)";
      pyenv install 2.7.6;
      pyenv global 2.7.6;
      pyenv rehash;
      pip install cpp-coveralls;
      pyenv rehash;
     fi;

install:
 - if [[ "${CXX}" =~ "g++" ]]; then export JOBS=2; fi;
 - if [[ ${COVERAGE} == false ]];
   then
   if [[ ${COMMIT_MESSAGE} =~ "[test binary]" ]];
      then npm install --fallback-to-build=false; 
      else ./scripts/build_against_sdk.sh && rm -rf sdk; 
   fi;
   else ./scripts/build_against_sdk.sh --coverage=true;
   fi;
 - npm test

before_script:
 - if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]] && [[ ${CXX} =~ "clang" ]] && [[ ${COVERAGE} == false ]]; then PUBLISH_BINARY=true; fi;
 - if [[ ${COMMIT_MESSAGE} =~ "[republish binary]" ]] && [[ ${CXX} =~ "clang" ]] && [[ ${COVERAGE} == false ]]; then REPUBLISH_BINARY=true; fi;

script:
 - node-pre-gyp package testpackage
 - if [[ ${COVERAGE} == true ]]; then cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude tools --exclude docs --exclude sdk --exclude build/Release/obj/gen --exclude src/mapnik_featureset.hpp --exclude src/mapnik_logger.hpp --exclude src/mapnik_image_view.hpp --exclude src/mapnik_geometry.hpp; fi;
 - if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp publish; fi;
 - if [[ ${REPUBLISH_BINARY} == true ]]; then node-pre-gyp unpublish && node-pre-gyp publish; fi;
 #- if [[ ${PUBLISH_BINARY} == true ]] || [[ ${REPUBLISH_BINARY} == true ]]; then node-pre-gyp info; rm -rf {build,lib/binding}; node-pre-gyp install; npm test; fi
 # always killed by travis
 #- nice -n 19 node --expose-gc bench/error/test_vt_abort.js
 - nice -n 19 node --expose-gc bench/error/test_vt_abort2.js<commit_msg>travis script fixups<commit_after>language: cpp

sudo: false

git:
  depth: 2

addons:
  apt:
    sources:
     - ubuntu-toolchain-r-test
     - llvm-toolchain-precise-3.6
    packages:
     - clang-3.6

matrix:
  include:
     # Coverage
     - os: osx
       compiler: clang
       env: NODE_VERSION="1.2.0" COVERAGE=true # node abi 43
     # Linux
     - os: linux
       compiler: clang
       env: NODE_VERSION="1.2.0" # node abi 43
     - os: linux
       compiler: clang
       env: NODE_VERSION="0.12.2" # node abi 14
     - os: linux
       compiler: clang
       env: NODE_VERSION="0.10.38" # node abi 11
     # OS X
     - os: osx
       compiler: clang
       env: NODE_VERSION="1.2.0" # node abi 43
     - os: osx
       compiler: clang
       env: NODE_VERSION="0.12.2" # node abi 14
     - os: osx
       compiler: clang
       env: NODE_VERSION="0.10.38" # node abi 11

env:
  global:
   - JOBS: "8"
   - MAPNIK_GIT: v3.0.0-rc1-1074-g5808b7f
   - secure: <KEY>
   - secure: <KEY>

before_install:
 - scripts/validate_tag.sh
 - export COVERAGE=${COVERAGE:-false}
 - if [[ $(uname -s) == 'Linux' ]]; then
     export CXX="clang++-3.6";
     export CC="clang-3.6";
     export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python2.7/site-packages;
   else
     export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python/site-packages;
   fi;
 - source ./scripts/install_node.sh ${NODE_VERSION}
 - export PATH=./node_modules/.bin/:$PATH

install:
 - COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
 - if [[ ${COVERAGE} == true ]]; then
     PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user cpp-coveralls;
     ./scripts/build_against_sdk.sh --coverage=true;
   else
     ./scripts/build_against_sdk.sh;
   fi
 - rm -rf sdk
 - node-pre-gyp package testpackage
 - npm test

before_script:
 - if [[ ${CXX} =~ "clang" ]] && [[ ${COVERAGE} == false ]]; then
      if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then
        node-pre-gyp publish;
      elif [[ ${COMMIT_MESSAGE} =~ "[republish binary]" ]]; then
        node-pre-gyp unpublish publish;
      fi
   fi

script:
 - node --expose-gc bench/error/test_vt_abort2.js
 # ugh: always killed by travis
 #- nice -n 19 node --expose-gc bench/error/test_vt_abort.js
{'fraction_non_alphanumeric': 0.1551899592944369, 'fraction_numerical': 0.023744911804613297, 'mean_word_length': 2.5979255643685173, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1111352', 'n_tokens_mistral': 2308, 'n_tokens_neox': 2180, 'n_words': 543}