|
| 1 | +# Copyright 2016 Peter Dimov |
| 2 | +# Copyright 2017, 2018 James E. King III |
| 3 | +# Distributed under the Boost Software License, Version 1.0. |
| 4 | +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) |
| 5 | + |
| 6 | +# |
| 7 | +# Generic Travis CI build script for boostorg repositories |
| 8 | +# |
| 9 | +# Instructions for customizing this script for your library: |
| 10 | +# |
| 11 | +# 1. Copy the ci/ directory from the same source into your project: |
| 12 | +# ci/build.sh runs the build |
| 13 | +# ci/codecov.sh is used to run a profiling build and upload results to codecov.io |
| 14 | +# ci/coverity.sh is used to run a coverity build and upload results to coverity scan |
| 15 | +# 2. Customize the compilers and language levels you want. Default is C++03. |
| 16 | +# 3. Update the global B2 environment settings to your liking. |
| 17 | +# 4. If you have more than include/, src/, and test/ directories then |
| 18 | +# add them to the depinst.py line as "--include tools" for tools/ (you |
| 19 | +# can put multiple --include on the command line). |
| 20 | +# 5. If you want to enable Coverity Scan, you need to provide the environment |
| 21 | +# variables COVERITY_SCAN_TOKEN and COVERITY_SCAN_NOTIFICATION_EMAIL in |
| 22 | +# your github settings. |
| 23 | +# 6. Enable pull request builds in your boostorg/<library> account. |
| 24 | +# 7. Change the default C++ version in ci/*.sh (search for CXXSTD) |
| 25 | +# |
| 26 | +# That's it - the scripts will do everything else for you. |
| 27 | + |
| 28 | +sudo: false |
| 29 | +dist: trusty |
| 30 | +language: cpp |
| 31 | + |
| 32 | +env: |
| 33 | + global: |
| 34 | + # see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties |
| 35 | + # to use the default for a given environment, comment it out; recommend you build debug and release however.. |
| 36 | + # - B2_ADDRESS_MODEL=address-model=64,32 |
| 37 | + # - B2_LINK=link=shared,static |
| 38 | + # - B2_THREADING=threading=multi,single |
| 39 | + - B2_VARIANT=variant=release,debug |
| 40 | + |
| 41 | +install: |
| 42 | + - export SELF=`basename $TRAVIS_BUILD_DIR` |
| 43 | + - cd .. |
| 44 | + - git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root |
| 45 | + - cd boost-root |
| 46 | + - git submodule update -q --init tools/boostdep |
| 47 | + - git submodule update -q --init tools/build |
| 48 | + - git submodule update -q --init tools/inspect |
| 49 | + - cp -r $TRAVIS_BUILD_DIR/* libs/$SELF |
| 50 | + - export BOOST_ROOT="`pwd`" |
| 51 | + - export PATH="`pwd`":$PATH |
| 52 | + - python tools/boostdep/depinst/depinst.py --include example $SELF |
| 53 | + - ./bootstrap.sh |
| 54 | + - ./b2 headers |
| 55 | + |
| 56 | +addons: |
| 57 | + apt: |
| 58 | + packages: |
| 59 | + - binutils-gold |
| 60 | + - gdb |
| 61 | + - libc6-dbg |
| 62 | + |
| 63 | +branches: |
| 64 | + only: |
| 65 | + - develop |
| 66 | + - master |
| 67 | + |
| 68 | +script: |
| 69 | + - cd libs/$SELF |
| 70 | + - ci/build.sh |
| 71 | + |
| 72 | +jobs: |
| 73 | + include: |
| 74 | + #################### Jobs to run on every pull request #################### |
| 75 | + - os: linux |
| 76 | + env: |
| 77 | + - COMMENT="C++03" |
| 78 | + - TOOLSET=gcc,gcc-7,clang |
| 79 | + addons: |
| 80 | + apt: |
| 81 | + packages: |
| 82 | + - g++-7 |
| 83 | + sources: |
| 84 | + - ubuntu-toolchain-r-test |
| 85 | + - os: linux |
| 86 | + env: |
| 87 | + - COMMENT="C++11" |
| 88 | + - TOOLSET=gcc,gcc-7,clang |
| 89 | + - CXXSTD=11 |
| 90 | + addons: |
| 91 | + apt: |
| 92 | + packages: |
| 93 | + - g++-7 |
| 94 | + sources: |
| 95 | + - ubuntu-toolchain-r-test |
| 96 | + - os: linux |
| 97 | + env: |
| 98 | + - COMMENT=valgrind |
| 99 | + - TOOLSET=clang |
| 100 | + - B2_VARIANT=variant=debug |
| 101 | + - TESTFLAGS=testing.launcher=valgrind |
| 102 | + - VALGRIND_OPTS=--error-exitcode=1 |
| 103 | + addons: |
| 104 | + apt: |
| 105 | + packages: |
| 106 | + - clang-5.0 |
| 107 | + - libstdc++-7-dev |
| 108 | + - valgrind |
| 109 | + sources: |
| 110 | + - llvm-toolchain-trusty-5.0 |
| 111 | + - ubuntu-toolchain-r-test |
| 112 | + |
| 113 | + - os: linux |
| 114 | + env: |
| 115 | + - COMMENT=cppcheck |
| 116 | + script: |
| 117 | + - libs/$SELF/ci/cppcheck.sh |
| 118 | + |
| 119 | + - os: linux |
| 120 | + env: |
| 121 | + - COMMENT=UBSAN |
| 122 | + - B2_VARIANT=variant=debug |
| 123 | + - TOOLSET=gcc-7 |
| 124 | + - CXXFLAGS="cxxflags=-fno-omit-frame-pointer cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined" |
| 125 | + - LINKFLAGS="linkflags=-fsanitize=undefined linkflags=-fno-sanitize-recover=undefined linkflags=-fuse-ld=gold" |
| 126 | + - UBSAN_OPTIONS=print_stacktrace=1 |
| 127 | + addons: |
| 128 | + apt: |
| 129 | + packages: |
| 130 | + - g++-7 |
| 131 | + sources: |
| 132 | + - ubuntu-toolchain-r-test |
| 133 | + |
| 134 | + - os: linux |
| 135 | + env: |
| 136 | + - COMMENT=CodeCov |
| 137 | + - TOOLSET=gcc-7 |
| 138 | + addons: |
| 139 | + apt: |
| 140 | + packages: |
| 141 | + - gcc-7 |
| 142 | + - g++-7 |
| 143 | + sources: |
| 144 | + - ubuntu-toolchain-r-test |
| 145 | + script: |
| 146 | + - pushd /tmp && git clone https://github.com/linux-test-project/lcov.git && cd lcov && sudo make install && which lcov && lcov --version && popd |
| 147 | + - cd libs/$SELF |
| 148 | + - ci/codecov.sh |
| 149 | + |
| 150 | + - os: osx |
| 151 | + osx_image: xcode9 |
| 152 | + env: |
| 153 | + - TOOLSET=clang |
| 154 | + - CXXSTD=03,11 |
| 155 | + |
| 156 | + #################### Jobs to run on pushes to master, develop ################### |
| 157 | + |
| 158 | + # Coverity Scan |
| 159 | + - os: linux |
| 160 | + if: (env(COVERITY_SCAN_TOKEN) IS present) AND (branch IN (develop, master)) AND (type IN (cron, push)) |
| 161 | + env: |
| 162 | + - COMMENT="Coverity Scan" |
| 163 | + - TOOLSET=gcc |
| 164 | + script: |
| 165 | + - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- |
| 166 | + - cd libs/$SELF |
| 167 | + - ci/coverity.sh |
| 168 | + |
| 169 | +notifications: |
| 170 | + email: |
| 171 | + false |
| 172 | + |
0 commit comments