• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2016 Peter Dimov
2# Copyright 2017 - 2019 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# See: https://github.com/boostorg/boost-ci
9#
10# Instructions for customizing this script for your library:
11#
12# 1. Customize the compilers and language levels you want in the 'jobs'.
13# 2. If you have more than include/, src/, test/, example/, examples/, or
14#    tools/ directories, modify your Travis CI project and add the environment
15#    variable DEPINST.  For example if your build uses code in "bench/" and
16#    "fog/" directories, then set DEPINST to the following:
17#        --include bench --include fog
18# 3. If you want to enable Coverity Scan, you need to provide the environment
19#    variables COVERITY_SCAN_TOKEN and COVERITY_SCAN_NOTIFICATION_EMAIL in
20#    your github settings.
21# 4. Enable pull request builds in your boostorg/<library> account.
22#
23# That's it - the scripts will do everything else for you.
24
25dist: xenial
26language: cpp
27
28env:
29  global:
30  # see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
31  # - B2_ADDRESS_MODEL=address-model=64,32
32  # - B2_LINK=link=shared,static
33  # - B2_THREADING=threading=multi,single
34    - B2_VARIANT=variant=release
35
36install:
37  - git clone https://github.com/boostorg/boost-ci.git boost-ci
38  - cp -pr boost-ci/ci boost-ci/.codecov.yml .
39  - source ci/travis/install.sh
40
41addons:
42  apt:
43    packages:
44      - binutils-gold
45      - gdb
46      - libc6-dbg
47
48branches:
49  only:
50    - master
51    - develop
52    - /bugfix\/.*/
53    - /feature\/.*/
54    - /fix\/.*/
55    - /pr\/.*/
56
57script:
58  - cd $BOOST_ROOT/libs/$SELF
59  - ci/travis/build.sh
60
61#
62# Default toolsets in Ubuntu
63#
64#       trusty xenial bionic
65#        14.04  16.04  18.04
66#       ------ ------ ------
67# clang    3.4    3.8    6.0
68#   gcc  4.8.2  5.3.1  7.3.0
69#
70
71anchors:
72  clang-38: &clang-38 { apt: { packages: [ "clang-3.8",
73                                           "libstdc++-6-dev" ], sources: [ "llvm-toolchain-xenial-3.8",
74                                                                           "ubuntu-toolchain-r-test"   ] } }
75  clang-4:  &clang-4  { apt: { packages: [ "clang-4.0",
76                                           "libstdc++-6-dev" ], sources: [ "llvm-toolchain-xenial-4.0",
77                                                                           "ubuntu-toolchain-r-test"   ] } }
78  clang-5:  &clang-5  { apt: { packages: [ "clang-5.0",
79                                           "libstdc++-7-dev" ], sources: [ "llvm-toolchain-xenial-5.0",
80                                                                           "ubuntu-toolchain-r-test"   ] } }
81  clang-6:  &clang-6  { apt: { packages: [ "clang-6.0",
82                                           "libc6-dbg",
83                                           "libc++-dev",
84                                           "libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-6.0",
85                                                                           "ubuntu-toolchain-r-test"   ] } }
86  clang-7:  &clang-7  { apt: { packages: [ "clang-7",
87                                           "libc6-dbg",
88                                           "libc++-dev",
89                                           "libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-7",
90                                                                           "ubuntu-toolchain-r-test"   ] } }
91  clang-8:  &clang-8  { apt: { packages: [ "clang-8",
92                                           "libc6-dbg",
93                                           "libc++-dev",
94                                           "libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-8",
95                                                                           "ubuntu-toolchain-r-test"   ] } }
96  gcc-48:   &gcc-48   { apt: { packages: [ "g++-4.8"         ]                                           } }
97  gcc-49:   &gcc-49   { apt: { packages: [ "g++-4.9"         ], sources: [ "ubuntu-toolchain-r-test"   ] } }
98  gcc-5:    &gcc-5    { apt: { packages: [ "g++-5"           ]                                           } }
99  gcc-6:    &gcc-6    { apt: { packages: [ "g++-6"           ], sources: [ "ubuntu-toolchain-r-test"   ] } }
100  gcc-7:    &gcc-7    { apt: { packages: [ "g++-7"           ], sources: [ "ubuntu-toolchain-r-test"   ] } }
101  gcc-8:    &gcc-8    { apt: { packages: [ "g++-8"           ], sources: [ "ubuntu-toolchain-r-test"   ] } }
102  gcc-9:    &gcc-9    { apt: { packages: [ "g++-9"           ], sources: [ "ubuntu-toolchain-r-test"   ] } }
103
104jobs:
105  allow_failures:
106    - env:
107      - COPY="all the environment settings from your job"
108
109  include:
110    # libstdc++
111    - { os: "linux", dist: "trusty",  # xenial has libstdc++ from gcc 5.4.0 with newer ABI
112                     env: [ "B2_TOOLSET=gcc-4.8",     "B2_CXXSTD=03,11"    ], addons: *gcc-48    }
113    - { os: "linux", dist: "trusty",  # xenial has libstdc++ from gcc 5.4.0 with newer ABI
114                     env: [ "B2_TOOLSET=gcc-4.9",     "B2_CXXSTD=03,11"    ], addons: *gcc-49    }
115    - { os: "linux", env: [ "B2_TOOLSET=gcc-5",       "B2_CXXSTD=03,11"    ], addons: *gcc-5     }
116    - { os: "linux", env: [ "B2_TOOLSET=gcc-6",       "B2_CXXSTD=11,14"    ], addons: *gcc-6     }
117    - { os: "linux", env: [ "B2_TOOLSET=gcc-7",       "B2_CXXSTD=14,17"    ], addons: *gcc-7     }
118    - { os: "linux", env: [ "B2_TOOLSET=gcc-8",       "B2_CXXSTD=17,2a"    ], addons: *gcc-8     }
119    - { os: "linux", env: [ "B2_TOOLSET=gcc-9",       "B2_CXXSTD=17,2a"    ], addons: *gcc-9     }
120    - { os: "linux", dist: "trusty",  # xenial has libstdc++ from gcc 5.4.0 with newer ABI
121                     env: [ "B2_TOOLSET=clang-3.8",   "B2_CXXSTD=03,11"    ], addons: *clang-38  }
122    - { os: "linux", env: [ "B2_TOOLSET=clang-4.0",   "B2_CXXSTD=11,14"    ], addons: *clang-4   }
123    - { os: "linux", env: [ "B2_TOOLSET=clang-5.0",   "B2_CXXSTD=11,14"    ], addons: *clang-5   }
124    - { os: "linux", env: [ "B2_TOOLSET=clang-6.0",   "B2_CXXSTD=14,17"    ], addons: *clang-6   }
125    - { os: "linux", env: [ "B2_TOOLSET=clang-7",     "B2_CXXSTD=17,2a"    ], addons: *clang-7   }
126    - { os: "linux", env: [ "B2_TOOLSET=clang-8",     "B2_CXXSTD=17,2a"    ], addons: *clang-8   }
127
128    # libc++
129    - { os: "linux", env: [ "B2_TOOLSET=clang-6.0",   "B2_CXXSTD=03,11,14",
130                            "B2_CXXFLAGS=-stdlib=libc++"                   ], addons: *clang-6   }
131    - { os: "osx"  , env: [ "B2_TOOLSET=clang",       "B2_CXXSTD=03,11,17" ]                     }
132
133    # to enable Intel ICC define INTEL_ICC_SERIAL_NUMBER and the following:
134    # - { os: "linux", env: [ "B2_TOOLSET=intel-linux", "B2_CXXSTD=11,14,17" ], addons: *gcc-7,
135    #     script: cd $BOOST_ROOT/libs/$SELF && ci/travis/intelicc.sh                               }
136
137    - os: linux
138      env:
139        - COMMENT=codecov.io
140        - B2_CXXSTD=03,11
141        - B2_TOOLSET=gcc-8
142        - B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
143      addons: *gcc-8
144      script:
145        - cd $BOOST_ROOT/libs/$SELF
146        - ci/travis/codecov.sh
147
148    - os: linux
149      env:
150        - COMMENT=asan
151        - B2_VARIANT=variant=debug
152        - B2_TOOLSET=gcc-8
153        - B2_CXXSTD=03,11,14
154        - B2_CXXFLAGS="address-sanitizer=norecover"
155        - B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
156      addons: *gcc-8
157
158    - os: linux
159      env:
160        - COMMENT=tsan
161        - B2_VARIANT=variant=debug
162        - B2_TOOLSET=gcc-8
163        - B2_CXXSTD=03,11,14
164        - B2_CXXFLAGS="thread-sanitizer=norecover"
165        - B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
166      addons: *gcc-8
167
168    - os: linux
169      env:
170        - COMMENT=ubsan
171        - B2_VARIANT=variant=debug
172        - B2_TOOLSET=gcc-8
173        - B2_CXXSTD=03,11,14
174        - B2_CXXFLAGS="undefined-sanitizer=norecover"
175        - B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
176        # https://github.com/boostorg/build/issues/451 using the gold linker to work around an issue
177        - B2_LINKFLAGS="linkflags=-fuse-ld=gold"
178        - UBSAN_OPTIONS=print_stacktrace=1
179      addons: *gcc-8
180
181    - os: linux
182      env:
183        - COMMENT=valgrind
184        - B2_TOOLSET=clang-6.0
185        - B2_CXXSTD=03,11,14
186        - B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
187        - B2_VARIANT=variant=debug
188        - B2_TESTFLAGS=testing.launcher=valgrind
189        - VALGRIND_OPTS=--error-exitcode=1
190      addons: *clang-6
191      script:
192        - cd $BOOST_ROOT/libs/$SELF
193        - ci/travis/valgrind.sh
194
195    # - os: linux
196    #   env:
197    #     - COMMENT=cppcheck
198    #   script:
199    #     - cd $BOOST_ROOT/libs/$SELF
200    #     - ci/travis/cppcheck.sh
201
202    #################### Jobs to run on pushes to master, develop ###################
203
204    # Coverity Scan
205    - os: linux
206      if: (env(COVERITY_SCAN_NOTIFICATION_EMAIL) IS present) AND (branch IN (develop, master)) AND (type IN (cron, push))
207      env:
208        - COMMENT="Coverity Scan"
209        - B2_TOOLSET=clang
210      script:
211        - cd $BOOST_ROOT/libs/$SELF
212        - ci/travis/coverity.sh
213
214notifications:
215  email:
216    false
217