sudo: false

language: cpp

os:
# - linux
  - osx

osx_image: xcode8

env:
  # code analysis
  - TASK=all_test

branches:
  only:
    - master

matrix:
  exclude:
    - os: osx
      env: TASK=lint

# dependent apt packages
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - doxygen
      - wget
      - git
      - unzip
      - gcc-4.8
      - g++-4.8
      - python-numpy
      - python-nose
      - python3-numpy
      - python3-dev
      - python3-nose
      - graphviz
      - bison
      - flex

before_install:
  - export PYTHONPATH=${PYTHONPATH}:${PWD}/python

install:
  - source dmlc-core/scripts/travis/travis_setup_env.sh
  - source tests/travis/setup.sh

script:
  - tests/travis/run_test.sh

cache:
  directories:
    - ${HOME}/.cache/usr

before_cache:
  - dmlc-core/scripts/travis/travis_before_cache.sh

after_failure:
  - tests/travis/travis_after_failure.sh

notifications:
  email:
    on_success: change
    on_failure: always
