forked from OpenApoc/OpenApoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (53 loc) · 1.77 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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