forked from OpenApoc/OpenApoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
50 lines (41 loc) · 1.84 KB
/
.travis.yml
File metadata and controls
50 lines (41 loc) · 1.84 KB
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
language: cpp
sudo: required
dist: bionic
cache: ccache
#compiler:
# - gcc
# - clang
matrix:
include:
- os: linux
env:
- MATRIX_ENV="PASS=build CXX='g++-9' CC='gcc-9' BUILD_TYPE=Quick"
- os: linux
env:
- MATRIX_ENV="PASS=build CXX='clang++-8' CC='clang-8' BUILD_TYPE=sanitize"
- os: linux
env:
- MATRIX_ENV="PASS=lint CLANG_FORMAT=clang-format-8"
# Passes todo:
# - osx
# - linux sanitize
# - linux static analysis (clang-tidy?)
before_install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
- sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main' -y
- sudo apt-get update -q
- sudo apt-get install g++-9 clang-8 clang-format-8 clang-tidy-8 ninja-build -y
- eval "${MATRIX_ENV}"
- env
- ./tools/travis-scripts/build_prepare_linux.sh
- ${CXX} --version
- ${CC} --version
before_script:
- export CFLAGS="-Wall" CXXFLAGS="-Wall -Werror -Wno-error=sign-compare"
- $(which time) cmake . -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCLANG_TIDY=clang-tidy-8 -DCLANG_FORMAT=clang-format-8 -DENABLE_TESTS=ON -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -GNinja
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) ninja && `which time` ctest -V -j 2; fi
- if [ "$PASS" = "lint" ]; then echo "clang-format linting range ${TRAVIS_COMMIT_RANGE}"; CLANG_FORMAT=${CLANG_FORMAT} ./tools/lint.sh ${TRAVIS_COMMIT_RANGE}; fi
- if [ "$PASS" = "lint" ]; then ninja generated-source && echo "clang-tidy linting range ${TRAVIS_COMMIT_RANGE}"; CLANG_TIDY=clang-tidy BUILD_DIR=$(pwd) ./tools/lint-tidy.sh ${TRAVIS_COMMIT_RANGE} || true; fi