forked from fkutzner/candy-kingdom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
83 lines (79 loc) · 2.08 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
language: cpp
compiler:
- gcc
- clang
os:
- linux
- osx
git:
depth: 1
dist: trusty
sudo: required
addons:
sonarcloud:
organization: "udopia-github"
token:
secure: $SONAR_TOKEN
cache:
directories:
- '$HOME/.sonar/cache'
env:
matrix:
- CANDY_MODE=REGULAR
- CANDY_MODE=COVERAGE
- CANDY_MODE=SANITIZERS
matrix:
global:
- ASAN_OPTIONS="detect_leaks=1"
exclude:
- os: osx
env: CANDY_MODE=COVERAGE
- os: osx
env: CANDY_MODE=SANITIZERS
- os: linux
compiler: clang
env: CANDY_MODE=COVERAGE
- os: linux
compiler: clang
env: CANDY_MODE=SANITIZERS
# allow_failures:
# - os: linux
# compiler: clang
before_script:
- if [ `uname` = "Linux" ]; then
sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa;
sudo add-apt-repository -y ppa:josh-bialkowski/cmake;
sudo apt-get update;
sudo apt-get install -y --force-yes cmake zlib1g-dev;
fi
- if [ "$CANDY_MODE" = "COVERAGE" ]; then
gem install coveralls-lcov;
sudo apt-get install lcov;
fi
script:
- pwd
- echo $TRAVIS_BUILD_DIR
- mkdir -p build
- cd build
- if [ "$CANDY_MODE" = "REGULAR" ]; then cmake -DCMAKE_BUILD_TYPE=Release $TRAVIS_BUILD_DIR; fi
- if [ "$CANDY_MODE" = "COVERAGE" ]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCANDY_ENABLE_COVERAGE=ON $TRAVIS_BUILD_DIR; fi
- if [ "$CANDY_MODE" = "SANITIZERS" ]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCANDY_ENABLE_ADDRESS_SANITIZER=ON $TRAVIS_BUILD_DIR; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
build-wrapper-linux-x86-64 --out-dir ../bw-output cmake --build . --config Release -- -j2;
else
cmake --build . --config Release -- -j2;
fi
- ctest -V
- if [[ ($TRAVIS_OS_NAME == 'linux') && ($CANDY_MODE == "COVERAGE") ]]; then
cd $TRAVIS_BUILD_DIR;
sonar-scanner;
fi
after_success:
- if [ "$CANDY_MODE" = "COVERAGE" ]; then
cd $TRAVIS_BUILD_DIR/build;
lcov --directory . --capture --output-file coverage.info;
lcov --remove coverage.info 'lib/*' 'testsrc/*' '/usr/*' --output-file coverage.info;
lcov --list coverage.info;
cd $TRAVIS_BUILD_DIR;
coveralls-lcov build/coverage.info;
fi