forked from pistacheio/pistache
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
158 lines (137 loc) · 4.1 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
language: cpp
dist: trusty
sudo: true
branches:
only:
- master
matrix:
include:
# Linux clang builds
- os: linux
compiler: clang
env:
- COMPILER=clang++-4.0
- COV_TOOL=llvm-cov-4.0
- COV_TOOL_ARGS=gcov
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
packages: [ 'cmake', 'clang-4.0', 'llvm-4.0-tools', 'libstdc++-6-dev', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck' ]
- os: linux
compiler: clang
env:
- COMPILER=clang++-5.0
- COV_TOOL=llvm-cov-5.0
- COV_TOOL_ARGS=gcov
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
packages: [ 'cmake', 'clang-5.0', 'llvm-5.0-tools', 'libstdc++-6-dev', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck' ]
- os: linux
compiler: clang
env:
- COMPILER=clang++-6.0
- COV_TOOL=llvm-cov-6.0
- COV_TOOL_ARGS=gcov
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
packages: [ 'cmake', 'clang-6.0', 'llvm-6.0-tools', 'libstdc++-6-dev', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck' ]
# Linux GCC builds
- os: linux
compiler: gcc
env:
- COMPILER=g++-4.9
- COV_TOOL=gcov-4.9
- COV_TOOL_ARGS=
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck']
- os: linux
compiler: gcc
env:
- COMPILER=g++-5
- COV_TOOL=gcov-5
- COV_TOOL_ARGS=
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck']
- os: linux
compiler: gcc
env:
- COMPILER=g++-6
- COV_TOOL=gcov-6
- COV_TOOL_ARGS=
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck']
- os: linux
compiler: gcc
env:
- COMPILER=g++-7
- COV_TOOL=gcov-7
- COV_TOOL_ARGS=
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck']
- os: linux
compiler: gcc
env:
- COMPILER=g++-8
- COV_TOOL=gcov-8
- COV_TOOL_ARGS=
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-8', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb', 'lcov', 'cppcheck']
install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
before_script:
- export CXX=${COMPILER}
- cd ${TRAVIS_BUILD_DIR}
# Enable core dumps
- ulimit -c
- ulimit -a -S
- ulimit -a -H
# Print debug system information
- cat /proc/sys/kernel/core_pattern
- cat /etc/default/apport
- service --status-all || true
- initctl list || true
# Debug build
- cmake -H.
-BBuild-Debug
-DCMAKE_BUILD_TYPE=Debug
-DPISTACHE_BUILD_EXAMPLES=true
-DPISTACHE_BUILD_TESTS=true
-DPISTACHE_USE_SSL=true
# Release build
- cmake -H.
-BBuild-Release
-DCMAKE_BUILD_TYPE=Release
-DPISTACHE_USE_SSL=true
script:
# Debug build
- cd Build-Debug
- make -j 2 all test ARGS="-V"
# Release build
- cd ../Build-Release
- make -j 2
after_failure:
- ls -lta /var/crash
- COREFILE=$(find ./ -maxdepth 1 -name "core*" -print | head -n 1)
- if [[ -f "$COREFILE" ]]; then
gdb -c "$COREFILE" -ex "thread apply all bt" -ex "set pagination 0" -batch;
fi
after_success:
- cd ../Build-Debug
- sudo su -c "echo 'if [ \"\$1\" = \"-v\" ] ; then $COV_TOOL --version ; else $COV_TOOL $COV_TOOL_ARGS \$@ ; fi' > /usr/local/bin/cov-tool" && sudo chmod +x /usr/local/bin/cov-tool
- lcov --capture --gcov-tool cov-tool --directory . --output-file coverage.info
- lcov --remove coverage.info '/usr/*' '*tests/*' '*third-party/*' --output-file coverage.info
- lcov --list coverage.info
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"