branches:
  only:
    - master

language: cpp

sudo: true

matrix:
  include:
    - language: python
      sudo: false
      python: 2.7
      env: TASKS="clang-format"

      dist: trusty
      addons:
        apt:
          sources:
          - ubuntu-toolchain-r-test
          - llvm-toolchain-trusty-6.0
          packages:
          - clang-format-6.0

    - compiler: gcc
      addons:
        apt:
          sources: ubuntu-toolchain-r-test
          packages: g++-4.9
      env:
        - TASKS="ctest gcc-4.9"
        - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"

    - compiler: gcc
      addons:
        apt:
          sources: ubuntu-toolchain-r-test
          packages: g++-6
      env:
        - TASKS="ctest gcc-6.3"
        - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"

    - compiler: clang
      env: TASKS="ctest clang-3.9"

install:
  - . ./scripts/travis/install.sh

script:
  - ./scripts/travis/build.sh
