language: cpp
sudo: true

matrix:
  include:
    # Linux g++ build
    - os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
      env:
        - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"

    # Linux clang++ build
    - os: linux
      addons:
        apt:
          sources:
            - llvm-toolchain-trusty-4.0
          packages:
            - clang-4.0
      env:
        - MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"

    # OSX g++ build
    - os: osx
      osx_image: xcode8.3
      compiler: gcc

    # OSX clang++ build
    - os: osx
      osx_image: xcode8.3
      compiler: clang

before_install:
  - eval "${MATRIX_EVAL}"

install: true

script:
  - cd C++
  - make all
  - make test

language: cpp
sudo: required

matrix:
  include:
    # Linux GCC 6 build
    - os: linux
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
      env:
        - COMPILER='g++-6'

    # Linux GCC 7 build
    - os: linux
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-7
      env:
        - COMPILER='g++-7'

    # Linux Clang 4 build
    - os: linux
      compiler: clang
      addons:
        apt:
          sources:
            - llvm-toolchain-trusty-4.0
          packages:
            - clang-4.0
      env:
        - COMPILER='clang++-4.0'

    # Linux Clang 5 build
    - os: linux
      compiler: clang
      addons:
        apt:
          sources:
            - llvm-toolchain-trusty-5.0
          packages:
            - clang-5.0
      env:
        - COMPILER='clang++-5.0'

    # OS X Xcode8 GCC build
    - os: osx
      osx_image: xcode8.3
      compiler: gcc
      env:
        - COMPILER='g++'

    # OS X Xcode9 GCC build
    - os: osx
      osx_image: xcode9.2
      compiler: gcc
      env:
        - COMPILER='g++'

    # OS X Xcode8 Clang build
    - os: osx
      osx_image: xcode8.3
      compiler: clang
      env:
        - COMPILER='clang++'

    # OS X Xcode9 Clang build
    - os: osx
      osx_image: xcode9.2
      compiler: clang
      env:
        - COMPILER='clang++'

before_install:
  - export CXX=${COMPILER}

install: true

script:
  - cd C++
  - make all && make test

Add more builds and update OSX image versions
Add more builds and update OSX image versions

On Ubuntu Trusty:
* GCC 6
* GCC 7
* Clang 4
* Clang 5

On OS X:
* GCC on Xcode8
* GCC on Xcode9
* Clang on Xcode8
* Clang on Xcode9
