-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.travis.yml
More file actions
230 lines (201 loc) · 11.1 KB
/
.travis.yml
File metadata and controls
230 lines (201 loc) · 11.1 KB
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
# Copyright Louis Dionne 2015
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
language: c++
compiler: clang
os: linux
# sudo: false | TODO: required by python-yaml and lcov
sudo: required
# This describes the test matrix
#
# env is used to set global variables:
# - COMPILER: selects the compiler
# - Note: clang uses libc++ and gcc uses libstdc++
# - BUILD_TYPE: selects the build type: Debug/Release
# - ASan: use AddressSanitizer: true/false
# - Valgrind: use valgrind: true/false
# - Site: build code to generate the site: true/false
# - Generates code coverage output
# - Runs the benchmarks
# - Generates documentation
# - Generates website
matrix:
include:
# The first case in the matrix for a given compiler defines how to install
# the compiler under addons, that is, we specify the ubuntu packages required
# and their sources (repositories).
#
# For example, for clang 3.7 trunk we need to get the nightly packages from
# the llvm repository for ubuntu precise.
#
# We store them in the variable clang37 using &clang37 which we can reference
# in the different builds using *clang37. This is done for each compiler.
#
# For each build we also define all the global variables specified above
# TODO: use defaults and define only some of them
# clang 3.7, debug build
- env: COMPILER=clang++-3.7 BUILD_TYPE=Debug
addons: &clang37
apt:
packages:
- clang-3.7
- valgrind
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise # latest
# clang 3.7, release build, ASan
- env: COMPILER=clang++-3.7 BUILD_TYPE=Release ASan=true
addons: *clang37
# clang 3.7, release build, valgrind
- env: COMPILER=clang++-3.7 BUILD_TYPE=Release Valgrind=true
addons: *clang37
# clang 3.7, release build
- env: COMPILER=clang++-3.7 BUILD_TYPE=Release
addons: *clang37
# GCC 5, debug build
- env: COMPILER=g++-5 BUILD_TYPE=Debug
addons: &gcc5
apt:
packages:
- g++-5
- valgrind
sources:
- ubuntu-toolchain-r-test
# GCC 5, release build, valgrind
- env: COMPILER=g++-5 BUILD_TYPE=Release Valgrind=true
addons: *gcc5
# Site generation job
#
# We define it here instead of in matrix.include because otherwise we end up
# with a job without environment variables within the matrix.
env:
global:
# GitHub token for pushing the documentation, logging in with the
# Travis command line utility and so on. The token is stored in the
# ${GITHUB_TOKEN} environment variable.
- secure: "Qlsp65HRdMW5UWfta/ZoynOnWQFMeVwxE7XU9yF1VnQXxpTEJFfgPY93ikPWX2NV9Hs53RwIwXD60cKXw6rMlqKIPMCrfG0zvJSmSjbP61IRat3jNmpXb6d4R855nk1AOlU6qJdEYtC0uuFYVe1p7XUEaUsEX+r1NKoiO2vg4Tc+zIIQdMEo5lWpH+XxkLipCq+9J9w4YY9phffkL3hPI9CM3tQtjv2l0XMcpKDRLdFXuBEh48yoyD6vf8b4XCVpn3rWw2PGSNLrUm2lCuYJwB5nlNhBSoTu/abNwpt7k69fcRmpGfVZsAyC0xp17ER1Qh5d79uzRZZvC+/H4TblI/djgfpFbGA+aRPe3uNJeOMJatbz3FoGrOkAvQ1thTB+hw+oNI7Z/Y/tS9OuOhVOEoJ3pysx7h2YdRGRprcOkRa39LBeABCsdgLd9IucsbxmJg76yeHWssldK6Tag7mVifOmnegaS0K8JcEXnhjiua98By1+4gtI8GFBynsd90tD5Miv/e9Q0FFM86B+Zf7FMauUQAeoXipqqsG/68+WynyKsbdxQPBHoZlMrmu+Bsma1k2rgg+D4TARC9cNCIkRuDg7nc4dyGS3r1IdeomzWpwU4C4kKudBo4tKRoUB9zaAn47iYqBWk2Q8y+dOlxR/l2mYM5yEkRqyPGxG+v2O/NI="
matrix:
- COMPILER=clang++-3.7 BUILD_TYPE=Debug Coverage=true Site=true
addons:
apt:
packages:
- clang-3.7
# Not allowed yet:
#- python-yaml
#- lcov
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise # latest
install:
############################################################################
# All the dependencies are installed to the deps/ subdirectory.
############################################################################
- DEPS_DIR="${PWD}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
############################################################################
# Install a recent CMake
############################################################################
- CMAKE_URL=http://www.cmake.org/files/v3.2/cmake-3.2.1-Linux-x86_64.tar.gz
- mkdir cmake
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
- export PATH=${PWD}/cmake/bin:${PATH}
############################################################################
# Install libc++ and libc++abi
############################################################################
- if [[ "${COMPILER}" =~ clang.+ ]]; then LLVM_URL="https://github.com/llvm-mirror/llvm/archive/master.tar.gz"; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then LIBCXX_URL="https://github.com/llvm-mirror/libcxx/archive/master.tar.gz"; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then LIBCXXABI_URL="https://github.com/llvm-mirror/libcxxabi/archive/master.tar.gz"; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then TAR_FMT="-xz"; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 ${TAR_FMT} -C llvm; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 ${TAR_FMT} -C llvm/projects/libcxx; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 ${TAR_FMT} -C llvm/projects/libcxxabi; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then (cd llvm/build && cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} && make cxx -j2); fi
############################################################################
# Install a recent Doxygen
############################################################################
- if [[ "${Site}" == "true" ]]; then DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.9.1.linux.bin.tar.gz"; fi
- if [[ "${Site}" == "true" ]]; then mkdir doxygen && travis_retry wget --quiet -O - ${DOXYGEN_URL} | tar --strip-components=1 -xz -C doxygen; fi
- if [[ "${Site}" == "true" ]]; then export PATH=${PWD}/doxygen/bin:${PATH}; fi
############################################################################
# Install and use a more recent Ruby and install the gems for the benchmarks
############################################################################
#- rvm use 2.1 --install --binary --fuzzy
#- gem install ruby-progressbar tilt
before_script:
############################################################################
# Go back to the root of the project.
############################################################################
- cd ${TRAVIS_BUILD_DIR}
############################################################################
# Set the git identity (for pushing the documentation and the benchmarks)
############################################################################
- git config --global user.name "Travis bot"
############################################################################
# Check baseline memory usage; useful to know when OOMs occur
############################################################################
- free
- vmstat
- ps aux --sort=-rss | head -n 10
############################################################################
# Travis VMs do not support anything higher than SSE 4.2
############################################################################
- sed -i 's/march=native/msse4.2/' CMakeLists.txt
############################################################################
# Setup the build directory
############################################################################
- mkdir build
- cd build
# Export the path to libc++
- if [[ "${COMPILER}" =~ clang.+ ]]; then export CXXFLAGS="-I ${DEPS_DIR}/llvm/build/include/c++/v1"; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then export LDFLAGS="-L ${DEPS_DIR}/llvm/build/lib -l c++ -l c++abi"; fi
- if [[ "${COMPILER}" =~ clang.+ ]]; then export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/build/lib"; fi
# We only use the memory checker for some builds, because otherwise it takes
# too long for very little benefit. Concretely, if we have a memory leak or
# something like that, it's either a compiler bug or an error that will show
# up regardless of the Boost version. Hence, we use the memory checker only
# once for each compiler.
- cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DPROJECT_NAME_ENABLE_WERROR=ON
- if [[ "${Valgrind}" == "true" ]]; then cmake .. -DPROJECT_NAME_ENABLE_VALGRIND=ON; fi
- if [[ "${ASan}" == "true" ]]; then cmake .. -DPROJECT_NAME_ENABLE_ASAN=ON; fi
script:
############################################################################
# Build the documentation
############################################################################
- if [[ "${Site}" == "true" ]]; then make doc; fi
############################################################################
# - Compile with code coverage
############################################################################
- if [[ "${Coverage}" == "true" ]]; then cmake .. -DPROJECT_NAME_ENABLE_COVERAGE=ON; fi
############################################################################
# Build and run the unit tests and examples.
############################################################################
- make tests -k -j2
- make examples -k -j2 &>/dev/null
- if [[ "${Valgrind}" != "true" ]]; then make check -k; fi
- if [[ "${Valgrind}" == "true" ]]; then ctest -VV -D ExperimentalMemCheck; fi
after_success:
############################################################################
# Update coveralls:
# - download and install lcov, and coveralls-lcov.
# - run lcov to generate coverage report
# - strip test/ and example/ subdirectories from coverage report
# - upload report to coveralls
############################################################################
- if [[ "${Coverage}" == "true" ]]; then export NAME=cpp_skeleton; fi
- if [[ "${Coverage}" == "true" ]]; then sudo apt-get install -qq python-yaml lcov; fi
- if [[ "${Coverage}" == "true" ]]; then gem install coveralls-lcov; fi
- if [[ "${Coverage}" == "true" ]]; then lcov --directory ./ --base-directory ./ --capture --output-file coverage.info; fi
- if [[ "${Coverage}" == "true" ]]; then lcov --remove coverage.info "/usr*" "*/$NAME/test/*" "*/$NAME/example/*" -o coverage.info; fi
- if [[ "${Coverage}" == "true" ]]; then coveralls-lcov coverage.info; fi
############################################################################
# Update the documentation
############################################################################
- if [[ "${Site}" == "true" && "${TRAVIS_PULL_REQUEST}" == "false" && "${TRAVIS_BRANCH}" == "master" ]]; then make gh-pages.push; fi # &>/dev/null; fi
#notifications:
# webhooks:
# urls: https://webhooks.gitter.im/e/ce1e3a2036d94b4a644f
# on_success: change
# on_failure: always
notifications:
email: false