language: cpp
cache: ccache

os:
  - linux
  - osx

compiler:
  - clang
  - gcc

env:
  global:
    - CCACHE_COMPRESS=1
    - CCACHE_CPP2=yes
  matrix:
    - CXX11=True
    - CXX11=False

matrix:
  exclude:
    - os: linux
      compiler: gcc
      env: CXX11=True
    - os: linux
      compiler: clang
      env: CXX11=False
    - os: osx
      compiler: gcc
      env: CXX11=False
    - os: osx
      compiler: clang
      env: CXX11=True

sudo: false

install:
  - ./.travis/install.sh

addons:
  apt:
    packages:
    - ccache
    - cmake
    - flex
    - bison
    - libblas-dev
    - liblapack-dev
    - libcfitsio3-dev
    - wcslib-dev
    - libfftw3-dev
    - gfortran
    - libncurses5-dev
    - libreadline6-dev
    - libhdf5-serial-dev
    - libboost-dev
    - libboost-python-dev
    - python-numpy
    - python3-numpy


before_script:
  - ./.travis/before_script.sh

script:
  - cd ${TRAVIS_BUILD_DIR}/build
  - ccache -s
  - ccache -z
  - make -j2
  - make test
  - make install
  - ccache -s

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/a21dbde2d416245fd698
    on_success: always
    on_failure: always
    on_start: false
