os:
  - linux
  - osx
sudo: false
language: cpp
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.8
env:
  matrix:
    - TRAVIS_NODE_VERSION="4"
    - TRAVIS_NODE_VERSION="5"
    - TRAVIS_NODE_VERSION="6"
    - TRAVIS_NODE_VERSION="7"
    - TRAVIS_NODE_VERSION="8"
    - TRAVIS_NODE_VERSION="9"
    - TRAVIS_NODE_VERSION="10"
    - TRAVIS_NODE_VERSION="11"
    - TRAVIS_NODE_VERSION="12"
cache:
  directories:
    - node_modules
install:
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
  - node --version
  - if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
  - $CXX --version
  - travis_retry npm install
script:
  - npm test
