Skip to content
Snippets Groups Projects
.travis.yml 5.60 KiB
sudo: false

language: cpp

addons: &addons
  apt:
    packages: timeout
    sources: &sources
      - ubuntu-toolchain-r-test
      - llvm-toolchain-precise-3.9

cache:
  apt: true
  ccache: true
#  directories:
#    - $BUILD_DEPS


# Do not build our sync branch.
branches:
  only:
    - master

# Without the top-level env, no job will be allowed to fail.
env:

matrix:
  # Abort all builds on a single failing matrix entry.
  fast_finish: true

  exclude:
    # Note: Workaround travis-ci/travis-ci#4681
    # Exclude default job which lacks our included environment variables.
    - os: linux

  include:
    # There seems to be a hard limit to how many machines a Travis build will
    # across all platforms. By interleaving OS X, the hope is to get in the
    # queue faster while not blocking Linux builds from occuring.
    - os: linux
      env: TOOL=clang-format
      addons:
        apt:
          sources: *sources
          packages: ['clang-format-3.9']
      compiler: clang

    - os: linux
      env: TOOL=clang-tidy
      addons:
        apt:
          sources: *sources
          packages: ['clang-3.9', 'clang-tidy-3.9', 'libstdc++-6-dev']
      compiler: clang

  allow_failures:
    # clang-tidy is still experimental
    - env: TOOL=clang-tidy
install:
  - |
    if [[ $TOOL == 'clang-tidy' ]]; then
      export BUILD_DEPS="${TRAVIS_BUILD_DIR}/deps"
      mkdir ${BUILD_DEPS} && cd ${BUILD_DEPS}
      CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.0-Linux-x86_64.tar.gz"
      mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
      export PATH=${BUILD_DEPS}/cmake/bin:${PATH}
      # Go to the Root directory
      cd -
    fi