matrix:
  fast_finish: true
  include:
    # QT5 based build with Python 3 // using container based builds and prebuild binary dependencies in osgeo4travis
    - os: linux
      language: python # This lets us use newer python versions from virtualenv
      env:
        - LLVM_VERSION=3.8
        - TRAVIS_CONFIG=linux
      dist: precise
      sudo: false
      cache:
        apt: true
        pip: true
        directories:
          - $HOME/.ccache
          - $HOME/depcache
        timeout: 1000
      compiler: clang
      python: "3.3"
      addons:
        postgresql: "9.4"
        apt:
          sources:
            - llvm-toolchain-precise-3.8
            - ubuntu-toolchain-r-test
          packages:
            - bison
            - flex
            - libpq-dev
            - libfcgi-dev
            - libfftw3-3
            - libgsl0-dev
            - pkg-config
            - poppler-utils
            - xvfb
            - clang-3.8
            - libzip-dev


    - os: linux
      language: python
      python: "3.5"
      env:
        - TRAVIS_CONFIG=code_layout
      dist: trusty
      sudo: false
      cache:
        apt: true
      addons:
        apt:
          sources:
            - sourceline: 'ppa:jonathonf/backports'  # silversearcher-ag backport
            - sourceline: 'ppa:sergey-dryabzhinsky/packages' # doxygen
          packages:
            - doxygen
            - graphviz
            - txt2tags
            - pkg-config
            - xvfb
            - flip
            # used for spell checks
            - perl  # sipify, lookahead regex in spell check script
            - silversearcher-ag
            - expect-dev  # unbuffer
            - coreutils
            - libyaml-tiny-perl
    # OSX based build with QT4 and Python 2
#    - os: osx
#      osx_image: xcode8.3 # MacOS 10.12: Sierra
#      cache:
#        pip: true
#        directories:
#          - $HOME/.ccache
#      env:
#        - TRAVIS_CONFIG=macos
#        - IGNORE_BUILD_FAILURES=YES
#
#  allow_failures:
#    - os: osx

git:
  depth: 30

notifications:
  irc: "chat.freenode.net#qgis-test"
  on_failure: change
  on_success: change
  skip_join: true

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/467e3aff72e344d1dae3
    on_success: change  # options: [always|never|change] default: always
    on_failure: always # options: [always|never|change] default: always
    on_start: never # default: never

before_install:
  - ./.ci/travis/${TRAVIS_CONFIG}/before_install.sh

install:
  - ./.ci/travis/${TRAVIS_CONFIG}/install.sh

before_script:
  - ./.ci/travis/${TRAVIS_CONFIG}/before_script.sh

script:
  - ./.ci/travis/${TRAVIS_CONFIG}/script.sh

after_script:
  - ./.ci/travis/${TRAVIS_CONFIG}/after_script.sh