-
Notifications
You must be signed in to change notification settings - Fork 17
/
.travis.yml
252 lines (218 loc) · 13.2 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
# Copyright Louis Dionne 2017
# 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: cpp
os: linux # Use Linux unless specified otherwise
dist: trusty # Use 'trusty' unless specified otherwise
sudo: false
# Do not build branches of the form "pr/*". By prefixing pull requests coming
# from branches inside the repository with pr/, this avoids building both the
# branch push _and_ the pull request.
branches:
except: /pr\/.*/
env:
global:
# GitHub token for pushing the benchmarks. The token is stored in the
# ${GITHUB_TOKEN} environment variable.
- secure: "TY3VQ9eOoYxiBvP6kR+WyE0pgJ5vmxgXhCqjhGPWiieKn3H8hUhhbacSnmODXJQ89jbcIgLxUSPSWq3ZAJNDPem0nyEfoBklnJFq7IrZ1sXZ3ywBcHHEq/09+LTsjElg+9NU6HRMmzuT1WCG76/KmQHL7THSjQoPKHLAbHLuTzWeMVzC1qB0JC/SsfFXmuB0ZCNIQsu6P9ADLUpUgjm1mEXiUIDIXtfFPUvhC7UCC+kw5OR4rmwWM0adzFJglA2gom73fxkX9O/qPtZh6nroV7Vu6cUsbTjmW7YlV+0Us5YWgulC7dJqAO8GrHbfk35n3unMs2ScJ4nzWVEFCwCFiMOWb8VWIPRSQXDjuxkc1Cuf8A2M6FnFqZqhXE2JlsUfVAgI7zrG5LytYJkJxxphV4Hbkf0gTJ8VdA6dHV69AX8BIcszhCPo2PdMRvA+3iAL8FIMopVtDDcra8glO8JsFsR6C5ptdXMpDZ2/KMvoZta8Rpk38YEsiwf9mI7vBDV5okWM071U1jbVDGc8FIDfC14xIwFy7WFOWtZA4KYQTS5PxqEyPxtIRNNdWfCiNcNmm4eozw/kSmcYzMQxheWTx2Wv9V7EdKcx1r7mmv/MXzGnKLRW4j5I7VbG3pMXWr2KA5+qQdnYRjK/xa0j1aOD1OWwE4Fzt4ETkVGzZ8dvFm8="
matrix:
include:
# Clang 4.0
- env: COMPILER=clang++-4.0 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["clang-4.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-4.0"] } }
- env: COMPILER=clang++-4.0 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["clang-4.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-4.0"] } }
- env: COMPILER=clang++-4.0 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["clang-4.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-4.0"] } }
- env: COMPILER=clang++-4.0 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["clang-4.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-4.0"] } }
# Clang 5.0
- env: COMPILER=clang++-5.0 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["clang-5.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] } }
- env: COMPILER=clang++-5.0 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["clang-5.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] } }
- env: COMPILER=clang++-5.0 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["clang-5.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] } }
- env: COMPILER=clang++-5.0 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["clang-5.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] } }
# Clang 6.0
- env: COMPILER=clang++-6.0 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["clang-6.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-6.0"] } }
- env: COMPILER=clang++-6.0 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["clang-6.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-6.0"] } }
- env: COMPILER=clang++-6.0 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["clang-6.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-6.0"] } }
- env: COMPILER=clang++-6.0 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["clang-6.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-6.0"] } }
# Clang 7
- env: COMPILER=clang++-7 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["clang-7"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-7"] } }
- env: COMPILER=clang++-7 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["clang-7"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-7"] } }
- env: COMPILER=clang++-7 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["clang-7"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-7"] } }
- env: COMPILER=clang++-7 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["clang-7"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-7"] } }
# GCC 4.8
- env: COMPILER=g++-4.8 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["g++-4.8"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-4.8 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["g++-4.8"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-4.8 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["g++-4.8"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-4.8 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["g++-4.8"], sources: ["ubuntu-toolchain-r-test"] } }
# GCC 4.9
- env: COMPILER=g++-4.9 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["g++-4.9"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-4.9 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["g++-4.9"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-4.9 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["g++-4.9"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-4.9 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["g++-4.9"], sources: ["ubuntu-toolchain-r-test"] } }
# GCC 5
- env: COMPILER=g++-5 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-5 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-5 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-5 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } }
# GCC 6
- env: COMPILER=g++-6 CMAKE_GENERATOR="Unix Makefiles" PART="1/4"
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-6 CMAKE_GENERATOR="Unix Makefiles" PART="2/4"
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-6 CMAKE_GENERATOR="Unix Makefiles" PART="3/4"
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-6 CMAKE_GENERATOR="Unix Makefiles" PART="4/4"
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
# GCC 7
- env: COMPILER=g++-7 CMAKE_GENERATOR="Unix Makefiles" PART="1/5"
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-7 CMAKE_GENERATOR="Unix Makefiles" PART="2/5"
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-7 CMAKE_GENERATOR="Unix Makefiles" PART="3/5"
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-7 CMAKE_GENERATOR="Unix Makefiles" PART="4/5"
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-7 CMAKE_GENERATOR="Unix Makefiles" PART="5/5"
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
# Test using the Ninja generator
- env: COMPILER=clang++-7 CMAKE_GENERATOR="Ninja"
addons: { apt: { packages: ["clang-7", "ninja-build"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-7"] } }
before_install:
# Parse the partition information, if any
- |
if [[ -v PART ]]; then
THIS_PART="$(echo ${PART} | cut -d '/' -f 1)"
TOTAL_PARTS="$(echo ${PART} | cut -d '/' -f 2)"
echo "This is part ${THIS_PART}/${TOTAL_PARTS}"
fi
# Except for CRON jobs, only run partitioned jobs once (early out if we're not the first job).
- |
if [[ "${TRAVIS_EVENT_TYPE}" != "cron" && -v PART && "${THIS_PART}" != "1" ]]; then
exit 0
fi
install:
- export CXX=${COMPILER} # Override CXX set by Travis
- ${CXX} --version
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
# Install a recent CMake
- CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
- mkdir cmake && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
- export PATH=${DEPS_DIR}/cmake/bin:${PATH}
- cmake --version
# Install libc++ and libc++abi if needed
- |
if [[ "${CXX%%+*}" == "clang" ]]; then
if [[ "${CXX}" == "clang++-4.0" ]]; then LLVM_VERSION="4.0.0";
elif [[ "${CXX}" == "clang++-5.0" ]]; then LLVM_VERSION="5.0.0";
elif [[ "${CXX}" == "clang++-6.0" ]]; then LLVM_VERSION="6.0.0";
elif [[ "${CXX}" == "clang++-7" ]]; then LLVM_VERSION="7.0.1";
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 -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm
travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install)
(cd llvm/build/projects/libcxx && make install -j2)
(cd llvm/build/projects/libcxxabi && make install -j2)
export CXXFLAGS="-nostdinc++ -isystem ${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 Boost headers
- BOOST_VERSION=1.66.0
- BOOST_DIR=${DEPS_DIR}/boost-${BOOST_VERSION}
- |
BOOST_URL="https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION//\./_}.tar.gz"
mkdir -p ${BOOST_DIR}
{ travis_retry wget -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${BOOST_DIR}; } || exit 1
# Install and use a more recent Ruby
- rvm use 2.1 --install --binary --fuzzy
- ruby --version
before_script:
# Set the git identity (for pushing the benchmarks)
- git config --global user.name "Travis bot"
- git config --global user.email "<>"
- cd ${TRAVIS_BUILD_DIR}
- (mkdir build && cd build && cmake .. -DBOOST_ROOT=${BOOST_DIR})
script:
# Do not run tests during CRON jobs.
- |
if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]; then
cmake --build build &&
(cd build && ctest --output-on-failure -j3)
fi
# During nightly builds, we generate the benchmarks and update the gh-pages
# branch with the data, but only for jobs that are partitioned. We partition
# jobs to avoid timeouts on Travis.
- |
if [[ "${TRAVIS_EVENT_TYPE}" == "cron" && -v PART ]]; then
ALL_BENCHMARKS=($(cmake --build build --target help | grep -E "benchmark\.\w+\." | cut -d " " -f 2 | sort))
SLICE_SIZE=$(expr ${#ALL_BENCHMARKS[@]} / ${TOTAL_PARTS} + ${#ALL_BENCHMARKS[@]} % ${TOTAL_PARTS})
SLICE_BEGIN=$(expr \( ${THIS_PART} - 1 \) \* ${SLICE_SIZE})
BENCHMARKS=(${ALL_BENCHMARKS[@]:${SLICE_BEGIN}:${SLICE_SIZE}})
for benchmark in ${BENCHMARKS[@]}; do
cmake --build build --target ${benchmark}
done &&
# Suppress output to avoid leaking the token when the command fails
git clone https://ldionne:${GITHUB_TOKEN}@github.com/ldionne/metabench --depth 1 --branch=gh-pages tmp &>/dev/null &&
for benchmark in ${BENCHMARKS[@]}; do
category="$(echo ${benchmark} | cut -d '.' -f 2)"
name="$(echo ${benchmark} | cut -d '.' -f 3)"
source="build/benchmark/${category}/${name}"
destination="tmp/_${category}/${CXX}/${name}"
rm -rf ${destination} &&
mkdir -p ${destination} &&
# Add a YAML front matter to every chart and every JSON file (for Jekyll).
{
echo "---"
echo "timestamp: $(date '+%a, %-d %b %Y')"
echo "compiler: ${CXX}"
echo "---"
cat ${source}/index.html
} > ${destination}/index.html
for dataset in ${source}/*.json; do
{
echo "---"
echo "---"
cat ${dataset}
} > ${destination}/$(basename ${dataset})
done
done &&
pushd tmp &&
git add --all . &&
git commit -m "[${CXX}] Update benchmarks (${PART})" &&
# Suppress output to avoid leaking the token
travis_retry git push origin gh-pages &>/dev/null &&
popd
fi