language: cpp

env:
  global:
    - CTEST_PARALLEL_LEVEL=4

matrix:
  include:
    - dist: trusty
      compiler: gcc
      env: BUILD_TYPE=Release
    - dist: xenial
      compiler: gcc
      env: BUILD_TYPE=Release
    - dist: bionic
      compiler: gcc
      env: BUILD_TYPE=Release
    - dist: bionic
      compiler: gcc
      env: BUILD_TYPE=Debug
    - os: osx
      compiler: clang
      env: BUILD_TYPE=Release

install:
  # Install dependencies for FCL
  - if [ "$TRAVIS_OS_NAME" = "linux" ]; then 'ci/install_linux.sh' ; fi
  - if [ "$TRAVIS_OS_NAME" = "osx"   ]; then 'ci/install_osx.sh'   ; fi

script:
  # Create build directory
  - mkdir build
  - cd build

  # Configure
  - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS=-w ..

  # Build
  - make -j2

  # Run unit tests
  - travis_wait 30 make -j2 test

  # Make sure we can install and uninstall with no issues
  - sudo make install
  - sudo make uninstall