forked from boostorg/hana
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
296 lines (250 loc) · 13.3 KB
/
.travis.yml
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
language: c++
compiler: clang
os: linux
sudo: false
matrix:
allow_failures:
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=trunk
- env: UNIT_TESTS=true COMPILER=clang++-3.8 BOOST_VERSION=1.59.0
include:
##########################################################################
# Clang 3.5
#
# Note that we use the memory checker only for one Boost version to speed
# up builds. There would be little benefit to run the memory checker on
# different Boost versions.
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.5 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DBOOST_HANA_ENABLE_MEMCHECK=ON"
addons: &clang35
apt:
packages: ["clang-3.5", "valgrind"]
sources: &sources
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.7
- llvm-toolchain-precise
##########################################################################
# Clang 3.6
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.6 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DBOOST_HANA_ENABLE_MEMCHECK=ON"
addons: &clang36
apt:
packages: ["clang-3.6", "valgrind"]
sources: *sources
##########################################################################
# Clang 3.7
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DBOOST_HANA_ENABLE_MEMCHECK=ON"
addons: &clang37
apt:
packages: ["clang-3.7", "valgrind"]
sources: *sources
##########################################################################
# Xcode 6.4
##########################################################################
- os: osx
env: UNIT_TESTS=true COMPILER=clang++ BOOST_VERSION=1.59.0
osx_image: xcode6.4
##########################################################################
# Xcode 7
##########################################################################
- os: osx
env: UNIT_TESTS=true COMPILER=clang++ BOOST_VERSION=1.59.0
osx_image: xcode7
##########################################################################
# Clang trunk (allowed to fail)
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.8 BOOST_VERSION=1.59.0
addons:
apt:
packages: ["clang-3.8"]
sources: *sources
##########################################################################
# Build without concept checks
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DBOOST_HANA_ENABLE_CONCEPT_CHECKS=OFF"
addons: *clang37
##########################################################################
# Build with libstdc++ instead of libc++
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=1.59.0 STDLIB=libstdc++
addons:
apt:
packages: ["clang-3.7", "g++-5"]
sources: *sources
##########################################################################
# Build without exceptions
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DBOOST_HANA_ENABLE_EXCEPTIONS=OFF"
addons: *clang37
##########################################################################
# Build with Boost 1.57.0, 1.58.0 and trunk
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=1.57.0
addons: *clang37
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=1.58.0
addons: *clang37
- env: UNIT_TESTS=true COMPILER=clang++-3.7 BOOST_VERSION=trunk
addons: *clang37
##########################################################################
# Build without Boost
##########################################################################
- env: UNIT_TESTS=true COMPILER=clang++-3.7
addons: *clang37
##########################################################################
# Benchmarks
##########################################################################
- env: BENCHMARKS=true COMPILER=clang++-3.5 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release"
addons: *clang35
# Clang 3.5 does not support debug info for `auto`, so we use the Default build type instead.
- env: BENCHMARKS=true COMPILER=clang++-3.5 BOOST_VERSION=1.59.0
addons: *clang35
- env: BENCHMARKS=true COMPILER=clang++-3.6 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release"
addons: *clang36
- env: BENCHMARKS=true COMPILER=clang++-3.6 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug"
addons: *clang36
- env: BENCHMARKS=true COMPILER=clang++-3.7 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release"
addons: *clang37
- env: BENCHMARKS=true COMPILER=clang++-3.7 BOOST_VERSION=1.59.0 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug"
addons: *clang37
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: "gikHKTxWGN9FnJ9m+F53Y5j7jWGAOKlL2ylcFM2o0KoXOkoNAK9bJpilNppRwWhgwpC3yTJDN0k7xh9I6Ec8L0G46Q2QZdtJ/NFvWbafpzQcrAg6+872yKlP8h3GHexwEDdAdxCv8g2HeavFrDcqynssI8IoIHyZmsR6Dwym+eo="
##########################################################################
# Documentation
#
# The Documentation job must be defined here instead of in matrix.include,
# because we otherwise end up with a job that has no environment variables
# at all in the matrix.
##########################################################################
matrix:
- DOCUMENTATION=true COMPILER=clang++-3.7 BOOST_VERSION=1.59.0
# Those addons apply only to the documentation job.
addons: *clang37
install:
############################################################################
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
############################################################################
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
############################################################################
# Install Boost headers
############################################################################
- if [[ "${BOOST_VERSION}" == "1.57.0" ]]; then BOOST_URL="http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz"; fi
- if [[ "${BOOST_VERSION}" == "1.58.0" ]]; then BOOST_URL="http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz"; fi
- if [[ "${BOOST_VERSION}" == "1.59.0" ]]; then BOOST_URL="http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz"; fi
- if [[ "${BOOST_URL}" != "" ]]; then mkdir boost && travis_retry wget --quiet -O - ${BOOST_URL} | tar --strip-components=1 -xz -C boost; fi
- |
if [[ "${BOOST_VERSION}" == "trunk" ]]; then
BOOST_URL="http://github.com/boostorg/boost.git"
travis_retry git clone --depth 1 --recursive --quiet ${BOOST_URL}
(cd boost && ./bootstrap.sh && ./b2 headers)
fi
- if [[ -d ${DEPS_DIR}/boost ]]; then CMAKE_OPTIONS+=" -DBOOST_ROOT=${DEPS_DIR}/boost"; fi
############################################################################
# Install a recent CMake
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake
fi
############################################################################
# Install libc++ and libc++abi (on Linux only; Xcode uses libc++ by default)
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" && "${STDLIB}" != "libstdc++" ]]; then
if [[ "${COMPILER}" == "clang++-3.5" ]]; then LLVM_VERSION="3.5.2"; fi
if [[ "${COMPILER}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2"; fi
if [[ "${COMPILER}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.0"; fi
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi
travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm
travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install -DCMAKE_CXX_COMPILER=clang++)
(cd llvm/build/projects/libcxx && make install -j2)
(cd llvm/build/projects/libcxxabi && make install -j2)
export CXXFLAGS="-I ${DEPS_DIR}/llvm/install/include/c++/v1"
export LDFLAGS="-L ${DEPS_DIR}/llvm/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/install/lib"
fi
############################################################################
# Install a recent Doxygen
############################################################################
- |
if [[ "${DOCUMENTATION}" == "true" ]]; then
DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.10.linux.bin.tar.gz"
mkdir doxygen && travis_retry wget --quiet -O - ${DOXYGEN_URL} | tar --strip-components=1 -xz -C doxygen
export PATH=${DEPS_DIR}/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:
############################################################################
# Set the git identity (for pushing the documentation and the benchmarks)
############################################################################
- git config --global user.name "Travis bot"
############################################################################
# Go back to the root of the project and setup the build directory
############################################################################
- cd ${TRAVIS_BUILD_DIR}
- mkdir build && cd build
- cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DBOOST_HANA_ENABLE_WERROR=ON ${CMAKE_OPTIONS}
script:
############################################################################
# Only push the documentation when we're on master, otherwise just make sure
# it builds properly. When we push, we disable the output to avoid leaking
# the GitHub token.
############################################################################
- |
if [[ "${DOCUMENTATION}" == "true" ]]; then
if [[ "${TRAVIS_PULL_REQUEST}" == "false" && "${TRAVIS_BRANCH}" == "master" ]]; then
make gh-pages.push &>/dev/null
else
make doc
fi
fi
############################################################################
# We only run the full benchmarks on `master` when we're not in a pull
# request, because otherwise it takes too much Travis resources.
# Otherwise, partial benchmarks are run automatically as part of the
# tests to make sure they compile and run properly.
#
# When we run the full benchmarks, we pre-clone the datasets branch so the
# next datasets.clone will just pull, which is pretty quick. This reduces
# the risk of push conflicts when these jobs all run at the same time. When
# we push, we use travis_retry to try again if we encounter a push conflict,
# and we disable the output to avoid leaking the GitHub token.
############################################################################
- |
if [[ "${BENCHMARKS}" == "true" && "${TRAVIS_PULL_REQUEST}" == "false" && "${TRAVIS_BRANCH}" == "master" ]]; then
make benchmarks
make datasets.clone
travis_retry make datasets.push &>/dev/null
fi
############################################################################
# Build and run the unit tests and examples.
############################################################################
- |
if [[ "${UNIT_TESTS}" == "true" ]]; then
export CTEST_PARALLEL_LEVEL=2 # Run unit tests on two cores
make check -j2 -k
fi
notifications:
webhooks:
urls: https://webhooks.gitter.im/e/ce1e3a2036d94b4a644f
on_success: change
on_failure: always