Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (53 sloc) 1.77 KB
language: cpp
sudo: required
dist: trusty
cache: ccache
#compiler:
# - gcc
# - clang
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- MATRIX_ENV="PASS=build CXX='g++-5' CC='gcc-5' BUILD_TYPE=RelWithDebInfo"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
env:
- MATRIX_ENV="PASS=build CXX='clang++-4.0' CC='clang-4.0' BUILD_TYPE=sanitize"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-4.0
packages:
- clang-format-4.0
env:
- MATRIX_ENV="PASS=lint CLANG_FORMAT=clang-format-4.0"
# Passes todo:
# - osx
# - linux sanitize
# - linux static analysis (clang-tidy?)
before_install:
- eval "${MATRIX_ENV}"
- env
- if [ "$TRAVIS_OS_NAME" = "linux" -a "$PASS" = "build" ]; then ./tools/travis-scripts/build_prepare_linux.sh; fi
- ${CXX} --version
- ${CC} --version
before_script:
- export CFLAGS="-Wall -Wextra" CXXFLAGS="-Wall -Wextra"
- if [ "$PASS" = "build" ]; then $(which time) cmake . -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCLANG_TIDY=clang-tidy-4.0 -DCLANG_FORMAT=clang-format-4.0 -DENABLE_TESTS=ON -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}"; fi
script:
# Create the GameState as that triggers the generated source commands
- if [ "$PASS" = "build" ]; then echo "Building revision $(git describe --tags --all --long --always)"; $(which time) make -j2 && `which time` ctest -V -j 2; fi
- if [ "$PASS" = "lint" ]; then echo "Linting range ${TRAVIS_COMMIT_RANGE}"; CLANG_FORMAT=${CLANG_FORMAT} ./tools/lint.sh ${TRAVIS_COMMIT_RANGE}; fi