onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 1 | sudo: false |
| 2 | language: c++ |
| 3 | |
| 4 | notifications: |
| 5 | email: |
| 6 | on_success: change |
| 7 | on_failure: always |
| 8 | # gitter |
| 9 | webhooks: |
| 10 | urls: https://webhooks.gitter.im/e/10941dd1c67e5e967706 |
| 11 | on_success: change |
| 12 | on_failure: always |
| 13 | git: |
| 14 | depth: 5 |
| 15 | |
onqtam | e2527e3 | 2016-05-09 17:33:09 +0300 | [diff] [blame] | 16 | # check out the ccache setup/teardown of Urho3D - https://github.com/urho3d/Urho3D/blob/master/.travis.yml |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 17 | cache: |
| 18 | - apt |
| 19 | - ccache |
| 20 | |
| 21 | env: |
| 22 | global: |
| 23 | - USE_CCACHE=1 |
| 24 | - CCACHE_SLOPPINESS=pch_defines,time_macros |
| 25 | - CCACHE_COMPRESS=1 |
onqtam | e2527e3 | 2016-05-09 17:33:09 +0300 | [diff] [blame] | 26 | - CCACHE_MAXSIZE=200M |
| 27 | - CCACHE_CPP2=1 |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 28 | - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" |
| 29 | # Workaround for https://github.com/travis-ci/travis-ci/issues/4681 |
| 30 | # "Defining the build matrix only with matrix.include leads to an additional, unwanted job" |
| 31 | matrix: |
| 32 | - TRAVIS_EMPTY_JOB_WORKAROUND=true |
| 33 | |
| 34 | # these apt sources will be referenced later (by using *name) |
| 35 | addons: |
| 36 | apt: |
| 37 | sources: &apt_sources |
| 38 | - ubuntu-toolchain-r-test |
| 39 | - llvm-toolchain-precise-3.5 |
| 40 | - llvm-toolchain-precise-3.6 |
| 41 | - llvm-toolchain-precise-3.7 |
| 42 | - llvm-toolchain-precise-3.8 |
| 43 | - llvm-toolchain-precise |
| 44 | |
| 45 | compiler: clang |
| 46 | os: linux |
| 47 | |
| 48 | matrix: |
| 49 | exclude: |
| 50 | - env: TRAVIS_EMPTY_JOB_WORKAROUND=true |
| 51 | |
| 52 | include: |
| 53 | # coverage |
| 54 | - env: COMPILER=g++ COVERALLS_SERVICE_NAME=travis-ci |
| 55 | compiler: gcc |
| 56 | addons: |
| 57 | apt: |
| 58 | packages: ["lcov", "curl"] |
| 59 | |
| 60 | # GCC 4.4 |
| 61 | - env: COMPILER=g++-4.4 |
| 62 | compiler: gcc |
| 63 | addons: &gcc44 |
| 64 | apt: |
| 65 | packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 66 | sources: *apt_sources |
| 67 | |
| 68 | # GCC 4.5 |
| 69 | - env: COMPILER=g++-4.5 |
| 70 | compiler: gcc |
| 71 | addons: &gcc45 |
| 72 | apt: |
| 73 | packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 74 | sources: *apt_sources |
| 75 | |
| 76 | # GCC 4.6 |
| 77 | - env: COMPILER=g++-4.6 |
| 78 | compiler: gcc |
| 79 | addons: &gcc46 |
| 80 | apt: |
| 81 | packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 82 | sources: *apt_sources |
| 83 | |
| 84 | # GCC 4.7 |
| 85 | - env: COMPILER=g++-4.7 |
| 86 | compiler: gcc |
| 87 | addons: &gcc47 |
| 88 | apt: |
| 89 | packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 90 | sources: *apt_sources |
| 91 | |
| 92 | # GCC 4.8 |
| 93 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 94 | compiler: gcc |
| 95 | addons: &gcc48 |
| 96 | apt: |
| 97 | packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 98 | sources: *apt_sources |
| 99 | |
| 100 | # GCC 4.9 |
| 101 | - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 102 | compiler: gcc |
| 103 | addons: &gcc49 |
| 104 | apt: |
| 105 | packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 106 | sources: *apt_sources |
| 107 | |
| 108 | # GCC 5 |
| 109 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 110 | compiler: gcc |
| 111 | addons: &gcc5 |
| 112 | apt: |
| 113 | packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 114 | sources: *apt_sources |
| 115 | |
| 116 | # # GCC 6 |
| 117 | # # released on 2016.04.27 |
| 118 | # # wait for it to enter the whitelist - https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise |
| 119 | # # also with homebrew under OSX!!! |
| 120 | # - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 121 | # compiler: gcc |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 122 | # addons: &gcc6 |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 123 | # apt: |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 124 | # packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 125 | # sources: *apt_sources |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 126 | |
| 127 | # Clang 3.4 |
| 128 | - env: COMPILER=clang++ HAS_ASAN_64=true HAS_UBSAN_64=true |
| 129 | addons: &clang |
| 130 | apt: |
| 131 | packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 132 | sources: *apt_sources |
| 133 | |
| 134 | # Clang 3.5 |
| 135 | - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 136 | addons: &clang35 |
| 137 | apt: |
| 138 | packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 139 | sources: *apt_sources |
| 140 | |
| 141 | # Clang 3.6 |
| 142 | - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 143 | addons: &clang36 |
| 144 | apt: |
| 145 | packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 146 | sources: *apt_sources |
| 147 | |
| 148 | # Clang 3.7 |
| 149 | - env: COMPILER=clang++-3.7 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757 |
| 150 | addons: &clang37 |
| 151 | apt: |
| 152 | packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 153 | sources: *apt_sources |
| 154 | |
| 155 | # Clang 3.8 |
| 156 | - env: COMPILER=clang++-3.8 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757 |
| 157 | addons: &clang38 |
| 158 | apt: |
| 159 | packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 160 | sources: *apt_sources |
| 161 | |
| 162 | # Xcode 6.1 Clang |
| 163 | - env: COMPILER=clang++ |
| 164 | os: osx |
| 165 | |
| 166 | # Xcode 6.2 Clang |
| 167 | - env: COMPILER=clang++ |
| 168 | osx_image: beta-xcode6.2 |
| 169 | os: osx |
| 170 | |
| 171 | # Xcode 6.3 Clang |
| 172 | - env: COMPILER=clang++ |
| 173 | osx_image: beta-xcode6.3 |
| 174 | os: osx |
| 175 | |
| 176 | # Xcode 6.4 Clang |
| 177 | - env: COMPILER=clang++ |
| 178 | osx_image: xcode6.4 |
| 179 | os: osx |
| 180 | |
| 181 | # Xcode 7 Clang |
| 182 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 183 | osx_image: xcode7 |
| 184 | os: osx |
| 185 | |
| 186 | # Xcode 7.1 Clang |
| 187 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 188 | osx_image: xcode7.1 |
| 189 | os: osx |
| 190 | |
| 191 | # Xcode 7.2 Clang |
| 192 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 193 | osx_image: xcode7.2 |
| 194 | os: osx |
| 195 | |
| 196 | # Xcode 7.3 Clang |
| 197 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 198 | osx_image: xcode7.3 |
| 199 | os: osx |
| 200 | |
| 201 | # OSX GCC 4.4 |
| 202 | - env: COMPILER=g++-4.4 |
| 203 | compiler: gcc |
| 204 | os: osx |
| 205 | |
| 206 | # OSX GCC 4.5 |
| 207 | - env: COMPILER=g++-4.5 |
| 208 | compiler: gcc |
| 209 | os: osx |
| 210 | |
| 211 | # OSX GCC 4.6 |
| 212 | - env: COMPILER=g++-4.6 |
| 213 | compiler: gcc |
| 214 | os: osx |
| 215 | |
| 216 | # OSX GCC 4.7 |
| 217 | - env: COMPILER=g++-4.7 |
| 218 | compiler: gcc |
| 219 | os: osx |
| 220 | |
| 221 | # OSX GCC 4.8 |
| 222 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 223 | compiler: gcc |
| 224 | os: osx |
| 225 | |
| 226 | # OSX GCC 4.9 |
| 227 | - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 228 | compiler: gcc |
| 229 | os: osx |
| 230 | |
| 231 | # OSX GCC 5 |
| 232 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 233 | compiler: gcc |
| 234 | os: osx |
| 235 | |
| 236 | # # OSX GCC 6 |
| 237 | # - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 238 | # compiler: gcc |
| 239 | # os: osx |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 240 | |
| 241 | # OSX LLVM-GCC |
| 242 | - env: COMPILER=g++ |
| 243 | compiler: gcc |
| 244 | os: osx |
| 245 | |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 246 | before_install: |
| 247 | - | |
| 248 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 249 | # update package list |
| 250 | brew update |
onqtam | e835b42 | 2016-05-09 15:42:00 +0300 | [diff] [blame] | 251 | # ccache |
| 252 | brew install ccache |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 253 | # valgrind |
| 254 | brew install valgrind |
| 255 | # cmake |
| 256 | if brew list -1 | grep -q "^cmake\$"; then |
| 257 | brew outdated cmake || brew upgrade cmake |
| 258 | else |
| 259 | brew install cmake |
| 260 | fi |
| 261 | # gcc |
| 262 | if [[ "${COMPILER}" = "g++-4.4" ]]; then |
| 263 | brew install gcc44 |
| 264 | fi |
| 265 | if [[ "${COMPILER}" = "g++-4.5" ]]; then |
| 266 | brew install gcc45 |
| 267 | fi |
| 268 | if [[ "${COMPILER}" = "g++-4.6" ]]; then |
| 269 | brew install gcc46 |
| 270 | fi |
| 271 | if [[ "${COMPILER}" = "g++-4.7" ]]; then |
| 272 | brew install gcc47 |
| 273 | fi |
| 274 | if [[ "${COMPILER}" = "g++-4.8" ]]; then |
| 275 | brew outdated gcc48 || brew upgrade gcc48 |
| 276 | fi |
| 277 | if [[ "${COMPILER}" = "g++-4.9" ]]; then |
| 278 | brew install gcc49 |
| 279 | fi |
| 280 | if [[ "${COMPILER}" = "g++-5" ]]; then |
| 281 | brew install gcc5 |
| 282 | fi |
| 283 | if [[ "${COMPILER}" = "g++-6" ]]; then |
| 284 | brew install gcc6 |
| 285 | fi |
| 286 | fi |
| 287 | - git submodule update --init --recursive |
| 288 | |
| 289 | install: |
| 290 | - ${CXX} --version |
onqtam | e835b42 | 2016-05-09 15:42:00 +0300 | [diff] [blame] | 291 | - export CXX="ccache ${COMPILER}" |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 292 | - ${CXX} --version |
| 293 | - ccache -s |
| 294 | |
| 295 | script: |
| 296 | # coverage - do not continue with other build configurations after that |
| 297 | - | |
| 298 | if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then |
| 299 | cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug . |
| 300 | make -j2 && make coveralls |
| 301 | exit |
| 302 | fi |
| 303 | |
| 304 | # initial run with options |
| 305 | - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} . |
| 306 | |
| 307 | # debug x86 |
| 308 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32" . |
| 309 | - make clean && make -j2 |
| 310 | # valgrind for 32bit under osx fails |
| 311 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 312 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 313 | # debug x64 |
| 314 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" . |
| 315 | - make clean && make -j2 |
| 316 | - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure |
| 317 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 318 | # release x86 |
| 319 | - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" . |
| 320 | - make clean && make -j2 |
| 321 | # valgrind for 32bit under osx fails |
| 322 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 323 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 324 | # release x64 |
| 325 | - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" . |
| 326 | - make clean && make -j2 |
| 327 | - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure |
| 328 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 329 | |
| 330 | # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers |
| 331 | - cmake -DTEST_MODE=NORMAL . |
| 332 | # - cmake -DTEST_MODE=COMPARE . |
| 333 | # on separate commands because when something fails I want to see which one exactly |
| 334 | - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 335 | - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 336 | - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 337 | - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 338 | - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 339 | - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 340 | - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
onqtam | e835b42 | 2016-05-09 15:42:00 +0300 | [diff] [blame] | 341 | - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 342 | |
| 343 | after_script: |
| 344 | - cat compile_commands.json |
onqtam | e2527e3 | 2016-05-09 17:33:09 +0300 | [diff] [blame] | 345 | |
| 346 | --- |
| 347 | |
| 348 | ######################################################################################################################## |
| 349 | ## COVERITY SCAN ####################################################################################################### |
| 350 | ######################################################################################################################## |
| 351 | |
| 352 | branch: {name: coverity_scan, active: yes, mandatory: yes} |
| 353 | language: cpp |
| 354 | compiler: gcc |
| 355 | sudo: false |
| 356 | |
| 357 | addons: |
| 358 | coverity_scan: |
| 359 | # COVERITY_SCAN_TOKEN added as env var in travis project |
| 360 | project: |
| 361 | name: onqtam/doctest |
| 362 | notification_email: vik.kirilov@gmail.com |
| 363 | build_command_prepend: cd examples/hello_world && cmake . |
| 364 | build_command: make |
| 365 | branch_pattern: coverity_scan |
| 366 | script: true |