-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
368 lines (330 loc) · 12.9 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
language: cpp
# Downloading ccache's cache is around 6s, uploading is around 3s.
cache: ccache
# The following two lines are required to use Docker.
sudo: required
services:
- docker
# What branches are we reacting upon.
branches:
only:
- master
- pre-release
- coverity_scan
- /^20..Q.*/
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "dkaHaPCuL2rUcUprWCDCkpJZIho9oX6Ns5GtC9I1HLjaRV7K2LuNFbHN1k+D/nQcA7etg9GSiVzFxhrJpch+0KyJnqX5VOj73wvshhplDfn1D2ap/Z5IH2NHQ6tZWL6gkEcXaHk82k5wyfNoh6qsxdy2jw1rJCzuHWX8Zojz2w0hqCYh1sTsWCA8gS6FQjtyU1f5i357ywXncK/LWsXXsxfErqI1caemI0VzAR5pQ3KFo8WDZ190yc1SWspsIM7I4NtSqxvuLJLEsEnLoy65yiEs0C2rJ+zXLe7WRyvxfJLJ5XbvAecvh57IqlcpN31owj34AJAoS6aHAYgW73YUqGRozfWLAY2pxwtpKlefCHh/kxNUjROIbe9aNLLgoz9y9Iwe7zoRwM3yvg54/4J3VPG00n5sCPbweE15QoQcmgJIGeocTUCV1JaG1Qx1wLZEWatcmMr/RWimxhDrU6QKpHNYym4LJJI3Z30qSTNrfm8i7LuiJ1bN0lSSYHAUNw2Bl33eU7dEFKbXLkP5ffECCZBRW1Z5mP1RwmGoX/PtFR7UZMAamLR51+/ATwLx0mnGyPi+ZVUKuQ4L062Ak8SM5cYRPFHZXD9l149Ez/9RMopZig9WnXayn3+VjgXTACY29SYjgZJVBgMzIhjEDn2JIogGJnsJ6sAYGISu+MBiGys="
matrix:
include:
# clang 5.0: Regular build using Travis' default compiler for performance reasons to determine the code coverage when running the test cases on any branch (except for coverity_scan) or PR.
- os: linux
dist: trusty
if: branch != coverity_scan
compiler: clang
env:
- DO_COVERAGE=1
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang
- COMPILER_CXX=clang++
- PATH=/usr/local/clang-5.0.0/bin:$PATH
- CXXFLAGS="-stdlib=libc++"
- LD_LIBRARY_PATH=/usr/local/clang-5.0.0/lib:$LD_LIBRARY_PATH
- BUILD=Debug
# clang/OSX: Build for pre-release to check if OSX could be built.
- os: osx
osx_image: xcode9.1
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang
- COMPILER_CXX=clang++
- BUILD=Release
# clang 4.0/armhf: Build for pre-release to check if armhf could be built.
- os: linux
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=1
- COMPILER_CC=
- COMPILER_CXX=
- BUILD=
- DOCKER_BUILD_ARCH=armhf
# GCC 5: Build for pre-release to check if Linux/GCC-5 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: gcc
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=gcc-5
- COMPILER_CXX=g++-5
- BUILD=Release
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-5
- g++-5
# GCC 6: Build for pre-release to check if Linux/GCC-6 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: gcc
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=gcc-6
- COMPILER_CXX=g++-6
- BUILD=Release
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-6
- g++-6
# GCC 7: Build for pre-release to check if Linux/GCC-7 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: gcc
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=gcc-7
- COMPILER_CXX=g++-7
- BUILD=Release
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-7
- g++-7
# GCC 8: Build for pre-release to check if Linux/GCC-8 could be built.
- os: linux
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=gcc-8
- COMPILER_CXX=g++-8
- BUILD=Release
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-8
- g++-8
# clang 3.8: Build for pre-release to check if Linux/clang-3.8 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang-3.8
- COMPILER_CXX=clang++-3.8
- BUILD=Release
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.8 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages: ['clang-3.8', 'g++-6']
# clang 3.9: Build for pre-release to check if Linux/clang-3.9 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang-3.9
- COMPILER_CXX=clang++-3.9
- BUILD=Release
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages: ['clang-3.9', 'g++-6']
# clang 4.0: Build for pre-release to check if Linux/clang-4.0 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang-4.0
- COMPILER_CXX=clang++-4.0
- BUILD=Release
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
packages: ['clang-4.0', 'g++-6']
# clang 5.0: Build for pre-release to check if Linux/clang-5.0 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang-5.0
- COMPILER_CXX=clang++-5.0
- BUILD=Release
addons:
apt:
sources:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
packages: ['clang-5.0', 'g++-6']
# clang 6.0: Build for pre-release to check if Linux/clang-6.0 could be built.
- os: linux
dist: trusty
if: branch = pre-release
compiler: gcc
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang-6.0
- COMPILER_CXX=clang++-6.0
- BUILD=Release
addons:
apt:
sources:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
packages: ['clang-6.0', 'g++-6']
# default GCC on Ubuntu Xenial.
# gcc 5.4: Build for pre-release to check if Linux/gcc-5.4 could be built.
- os: linux
dist: xenial
if: branch = pre-release
compiler: gcc
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=gcc
- COMPILER_CXX=g++
- BUILD=Release
# default clang on Ubuntu Xenial.
# clang 7.0: Build for pre-release to check if Linux/clang-7.0 could be built.
- os: linux
dist: xenial
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang
- COMPILER_CXX=clang++
- BUILD=Release
# default GCC on Ubuntu Bionic.
# gcc 7.4: Build for pre-release to check if Linux/gcc-7.4 could be built.
- os: linux
dist: bionic
if: branch = pre-release
compiler: gcc
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=gcc
- COMPILER_CXX=g++
- BUILD=Release
# default clang on Ubuntu Bionic.
# clang 7.0: Build for pre-release to check if Linux/clang-7.0 could be built.
- os: linux
dist: bionic
if: branch = pre-release
compiler: clang
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=0
- DO_DOCKER_BUILD=0
- COMPILER_CC=clang
- COMPILER_CXX=clang++
- BUILD=Release
# GCC 6: Regular build to run coverity_scan analysis.
- os: linux
if: branch = coverity_scan
compiler: gcc
env:
- DO_COVERAGE=0
- DO_COVERITY_SCAN=1
- DO_DOCKER_BUILD=0
- COMPILER_CC=gcc-6
- COMPILER_CXX=g++-6
- BUILD=Debug
- COVERITY_SCAN_PROJECT_NAME="chrberger/libcluon"
- COVERITY_SCAN_BRANCH_PATTERN="coverity_scan"
- COVERITY_SCAN_NOTIFICATION_EMAIL="libcluon@christianberger.net"
- COVERITY_SCAN_BUILD_COMMAND_PREPEND="mkdir -p builds/non-docker && cd builds/non-docker && cmake -D CMAKE_BUILD_TYPE=Release ../../libcluon"
- COVERITY_SCAN_BUILD_COMMAND="make"
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-6
- g++-6
before_install:
# Steps for coverity_scan.
- if [[ ${DO_COVERITY_SCAN} == "1" ]]; then echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-; fi
# Re-adjust compiler symlinks to make coverity_scan work properly.
- if [[ ${DO_COVERITY_SCAN} == "1" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90; fi
- if [[ ${DO_COVERITY_SCAN} == "1" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90; fi
# The following call is actually executing the build.
- if [[ ${DO_COVERITY_SCAN} == "1" ]]; then curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash || true; fi
# Fixes for ccache and clang.
- if [[ "${DO_DOCKER_BUILD}" == "0" ]]; then if [[ "${DO_COVERITY_SCAN}" == "0" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo ln -s /usr/bin/ccache /usr/lib/ccache/clang; fi; fi; fi
- if [[ "${DO_DOCKER_BUILD}" == "0" ]]; then if [[ "${DO_COVERITY_SCAN}" == "0" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo ln -s /usr/bin/ccache /usr/lib/ccache/clang++; fi; fi; fi
# This environment variable is needed to let ccache handle the preprocessor from clang correctly.
- if [[ "${DO_DOCKER_BUILD}" == "0" ]]; then if [[ "${DO_COVERITY_SCAN}" == "0" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then export CCACHE_CPP2=yes; fi; fi; fi
install:
- if [[ "${COMPILER_CC}" != "" ]]; then export CC=${COMPILER_CC}; fi
- if [[ "${COMPILER_CXX}" != "" ]]; then export CXX=${COMPILER_CXX}; fi
# Enabling ARM emulation.
before_script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo sh -c "echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register"; fi
script:
- if [[ "${DO_DOCKER_BUILD}" == "0" ]]; then if [[ "${DO_COVERAGE}" == "0" ]]; then if [[ "${DO_COVERITY_SCAN}" == "0" ]]; then mkdir -p builds/non-docker && cd builds/non-docker && cmake -D CMAKE_BUILD_TYPE=${BUILD} -D ENABLE_COVERAGE=${DO_COVERAGE} ../../libcluon && make && CTEST_OUTPUT_ON_FAILURE=1 make test; fi; fi; fi
- if [[ "${DO_DOCKER_BUILD}" == "0" ]]; then if [[ "${DO_COVERAGE}" == "1" ]]; then if [[ "${DO_COVERITY_SCAN}" == "0" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then mkdir -p builds/non-docker && cd builds/non-docker && cmake -D CMAKE_BUILD_TYPE=${BUILD} -D ENABLE_COVERAGE=${DO_COVERAGE} ../../libcluon && make && CTEST_OUTPUT_ON_FAILURE=1 make test && for i in $(grep '^[^#[:space:]].*:' Makefile|grep "ShowCoverage_"|grep -v ".PHONY"|grep -v "/fast:"|cut -f1 -d":"); do make $i; done | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | sed -e '/\/catch.hpp/,/^$/d' | sed -e '/^\/usr\/include/,/^$/d' | sed -e '/\[100%\]/d' | sed -e 's/.*\libcluon\/src/libcluon\/src/g' | sed -e 's/.*\libcluon\/test/libcluon\/test/g' > app.coverage.txt; fi; fi; fi; fi
- if [[ "${DO_DOCKER_BUILD}" == "0" ]]; then if [[ "${DO_COVERITY_SCAN}" == "1" ]]; then echo "coverity_scan build executed."; fi; fi
- if [[ "${DO_DOCKER_BUILD}" == "1" ]]; then make ARCH=$DOCKER_BUILD_ARCH IMAGE=debian-$DOCKER_BUILD_ARCH; fi
after_success:
- if [[ "${DO_COVERAGE}" == "1" ]]; then bash <(curl -s https://codecov.io/bash); fi
notifications:
email:
recipients:
- libcluon@christianberger.net
on_success: change
on_failure: always