blob: 83ddf4eeab03c916526a49b8d42276bbe2c28dfd [file] [log] [blame]
onqtame85b1bb2016-06-26 16:41:09 +03001# this file is HEAVILY influenced by https://github.com/boostorg/hana/blob/master/.travis.yml
2
onqtame4c75fc2016-05-21 01:24:48 +03003sudo: false
4language: c++
5
6notifications:
7 email:
8 on_success: change
9 on_failure: always
10 # gitter
11 webhooks:
12 urls: https://webhooks.gitter.im/e/10941dd1c67e5e967706
13 on_success: change
14 on_failure: always
15git:
onqtam9f934f82016-08-02 12:42:19 +030016 depth: 500
onqtame4c75fc2016-05-21 01:24:48 +030017
18# both apt and ccache make the builds slower...
19#cache:
20# - apt
21# - ccache
22
23env:
24 global:
25# - USE_CCACHE=1
26# - CCACHE_SLOPPINESS=pch_defines,time_macros
27# - CCACHE_COMPRESS=1
28# - CCACHE_MAXSIZE=200M
29# - CCACHE_CPP2=1
30 - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
31 # Workaround for https://github.com/travis-ci/travis-ci/issues/4681
32 # "Defining the build matrix only with matrix.include leads to an additional, unwanted job"
33 matrix:
34 - TRAVIS_EMPTY_JOB_WORKAROUND=true
35
36addons:
37 coverity_scan:
38 # COVERITY_SCAN_TOKEN added as env var in travis project
39 project:
40 name: onqtam/doctest
41 notification_email: vik.kirilov@gmail.com
42 build_command_prepend: cd examples/hello_world && cmake .
43 build_command: make
44 branch_pattern: coverity_scan
45 # these apt sources will be referenced later (by using *name)
46 apt:
onqtam2c8036f2016-06-26 17:12:42 +030047 sources: &apt_sources
48 - ubuntu-toolchain-r-test
onqtamb382bd32016-08-01 20:53:56 +030049 - llvm-toolchain-precise-3.5
50 - llvm-toolchain-precise-3.6
51 - llvm-toolchain-precise-3.7
52 - llvm-toolchain-precise-3.8
53 - llvm-toolchain-precise
onqtame4c75fc2016-05-21 01:24:48 +030054
55compiler: clang
56os: linux
57
58matrix:
59 exclude:
60 - env: TRAVIS_EMPTY_JOB_WORKAROUND=true
61
62 include:
onqtamd1737e42016-08-01 19:05:07 +030063 # coverage
64 - env: COMPILER=g++ COVERALLS_SERVICE_NAME=travis-ci
65 compiler: gcc
66 addons:
67 apt:
68 packages: ["lcov", "curl"]
69
onqtamcc9e8652016-08-02 14:23:38 +030070# # GCC 4.4
71# - env: COMPILER=g++-4.4
72# compiler: gcc
73# addons: &gcc44
74# apt:
75# packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"]
76# sources: *apt_sources
77#
78# # GCC 4.5
79# - env: COMPILER=g++-4.5
80# compiler: gcc
81# addons: &gcc45
82# apt:
83# packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"]
84# sources: *apt_sources
85#
86# # GCC 4.6
87# - env: COMPILER=g++-4.6
88# compiler: gcc
89# addons: &gcc46
90# apt:
91# packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"]
92# sources: *apt_sources
93#
94# # GCC 4.7
95# - env: COMPILER=g++-4.7
96# compiler: gcc
97# addons: &gcc47
98# apt:
99# packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"]
100# sources: *apt_sources
101#
102# # GCC 4.8
103# - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
104# compiler: gcc
105# addons: &gcc48
106# apt:
107# packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
108# sources: *apt_sources
109#
110# # GCC 4.9
111# - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
112# compiler: gcc
113# addons: &gcc49
114# apt:
115# packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
116# sources: *apt_sources
117#
118# # GCC 5
119# - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold"
120# compiler: gcc
121# addons: &gcc5
122# apt:
123# packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"]
124# sources: *apt_sources
125#
126# # GCC 6
127# - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold"
128# compiler: gcc
129# addons: &gcc6
130# apt:
131# packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
132# sources: *apt_sources
133#
134# # Clang 3.4
135# - env: COMPILER=clang++ LLVM_VERSION=3.4.2 HAS_ASAN_64=true HAS_UBSAN_64=true
136# addons: &clang
137# apt:
138# packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
139# sources: *apt_sources
140#
141# # Clang 3.5
142# - env: COMPILER=clang++-3.5 LLVM_VERSION=3.5.2 HAS_ASAN_64=true HAS_UBSAN_64=true
143# addons: &clang35
144# apt:
145# packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
146# sources: *apt_sources
147#
148# # Clang 3.6
149# - env: COMPILER=clang++-3.6 LLVM_VERSION=3.6.2 HAS_ASAN_64=true HAS_UBSAN_64=true
150# addons: &clang36
151# apt:
152# packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
153# sources: *apt_sources
154#
155# # Clang 3.7
156# - env: COMPILER=clang++-3.7 LLVM_VERSION=3.7.1
157# addons: &clang37
158# apt:
159# packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
160# sources: *apt_sources
161#
162# # Clang 3.8
163# - env: COMPILER=clang++-3.8 LLVM_VERSION=3.8.0 HAS_ASAN_64=true HAS_UBSAN_64=true
164# addons: &clang38
165# apt:
166# packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
167# sources: *apt_sources
168#
169# # Xcode 6.1 Clang
170# - env: COMPILER=clang++
171# os: osx
172#
173# # Xcode 6.2 Clang
174# - env: COMPILER=clang++
175# osx_image: beta-xcode6.2
176# os: osx
177#
178# # Xcode 6.3 Clang
179# - env: COMPILER=clang++
180# osx_image: beta-xcode6.3
181# os: osx
182#
183# # Xcode 6.4 Clang
184# - env: COMPILER=clang++
185# osx_image: xcode6.4
186# os: osx
187#
188# # Xcode 7 Clang
189# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
190# osx_image: xcode7
191# os: osx
192#
193# # Xcode 7.1 Clang
194# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
195# osx_image: xcode7.1
196# os: osx
197#
198# # Xcode 7.2 Clang
199# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
200# osx_image: xcode7.2
201# os: osx
202#
203# # Xcode 7.3 Clang
204# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
205# osx_image: xcode7.3
206# os: osx
207#
208# # Xcode 8 Clang
209# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
210# osx_image: xcode8
211# os: osx
212#
213# # OSX GCC 4.4
214# - env: COMPILER=g++-4.4
215# compiler: gcc
216# os: osx
217#
218# # OSX GCC 4.5
219# - env: COMPILER=g++-4.5
220# compiler: gcc
221# os: osx
222#
223# # OSX GCC 4.6
224# - env: COMPILER=g++-4.6
225# compiler: gcc
226# os: osx
227#
228# # OSX GCC 4.7
229# - env: COMPILER=g++-4.7
230# compiler: gcc
231# os: osx
232#
233# # OSX GCC 4.8
234# - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
235# compiler: gcc
236# os: osx
237#
238# # OSX GCC 4.9
239# - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
240# compiler: gcc
241# os: osx
242#
243# # OSX GCC 5
244# - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
245# compiler: gcc
246# os: osx
247#
248# # OSX GCC 6
249# - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
250# compiler: gcc
251# os: osx
252#
253# # OSX LLVM-GCC
254# - env: COMPILER=g++
255# compiler: gcc
256# os: osx
onqtame4c75fc2016-05-21 01:24:48 +0300257
onqtam3ffb8872016-06-07 23:46:09 +0300258 allow_failures:
onqtam3ffb8872016-06-07 23:46:09 +0300259
onqtame4c75fc2016-05-21 01:24:48 +0300260before_install:
onqtam2c8036f2016-06-26 17:12:42 +0300261 - git submodule update --init --recursive
262
263install:
onqtam01158572016-06-28 14:29:32 +0300264 ############################################################################
265 # Install stuff with homebrew under OSX
266 ############################################################################
onqtam23c6a342016-06-28 14:09:10 +0300267 - |
onqtame4c75fc2016-05-21 01:24:48 +0300268 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
269 brew update
270 # brew install ccache
271 brew install valgrind
272 # cmake
273 if brew list -1 | grep -q "^cmake\$"; then
274 brew outdated cmake || brew upgrade cmake
275 else
276 brew install cmake
277 fi
278 # gcc
279 if [[ "${COMPILER}" = "g++-4.4" ]]; then
280 brew install gcc44
281 fi
282 if [[ "${COMPILER}" = "g++-4.5" ]]; then
283 brew install gcc45
284 fi
285 if [[ "${COMPILER}" = "g++-4.6" ]]; then
286 brew install gcc46
287 fi
288 if [[ "${COMPILER}" = "g++-4.7" ]]; then
289 brew install gcc47
290 fi
291 if [[ "${COMPILER}" = "g++-4.8" ]]; then
292 brew outdated gcc48 || brew upgrade gcc48
293 fi
294 if [[ "${COMPILER}" = "g++-4.9" ]]; then
295 brew install gcc49
296 fi
297 if [[ "${COMPILER}" = "g++-5" ]]; then
298 brew install gcc5
299 fi
300 if [[ "${COMPILER}" = "g++-6" ]]; then
301 brew install gcc6
302 fi
303 fi
onqtame4c75fc2016-05-21 01:24:48 +0300304 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300305# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300306# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300307
308before_script:
309 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300310
311script:
312 # coverage - do not continue with other build configurations after that
313 - |
314 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
315 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam316fce22016-05-21 16:57:13 +0300316 make -k -j2 && make coveralls
onqtame4c75fc2016-05-21 01:24:48 +0300317 exit
318 fi
319
320 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300321 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300322
onqtam1586ea22016-05-21 18:02:26 +0300323 # debug x64
onqtamfa5a8522016-06-26 20:15:56 +0300324 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300325 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300326 # valgrind for 64bit under osx fails TOO
327 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300328 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
329 # release x64
onqtamfa5a8522016-06-26 20:15:56 +0300330 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300331 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300332 # valgrind for 64bit under osx fails TOO
333 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300334 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300335 # debug x86
onqtamfa5a8522016-06-26 20:15:56 +0300336 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32" .
onqtam316fce22016-05-21 16:57:13 +0300337 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300338 # valgrind for 32bit under osx fails
339 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300340 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300341 # release x86
onqtamfa5a8522016-06-26 20:15:56 +0300342 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32" .
onqtam316fce22016-05-21 16:57:13 +0300343 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300344 # valgrind for 32bit under osx fails
345 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300346 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300347
348 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam1586ea22016-05-21 18:02:26 +0300349 - cmake -DTEST_MODE=COMPARE .
onqtame4c75fc2016-05-21 01:24:48 +0300350 # on separate commands because when something fails I want to see which one exactly
onqtamfa5a8522016-06-26 20:15:56 +0300351 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
352 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
353 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
354 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
355 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
356 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
357 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
358 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
onqtame4c75fc2016-05-21 01:24:48 +0300359
360# - ccache -s
361
onqtam2dd55282016-06-13 18:05:38 +0300362#after_script:
363# - cat compile_commands.json