forked from sxs-collaboration/spectre
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
422 lines (406 loc) · 14.6 KB
/
.travis.yml
File metadata and controls
422 lines (406 loc) · 14.6 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
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# Distributed under the MIT License.
# See LICENSE.txt for details.
# The online TravisCI configuration:
#
# General:
# - Build only if .travis.yml is present: ON
# - Build branch updates: ON
# - Build pull request updates: ON
# - Limit concurrent jobs: OFF
#
# Auto Cancellation:
# - Auto cancel branch builds: ON
# - Auto cancel pull request builds: ON
#
# Environment Variables:
# - COVERALLS_TOKEN: Sign up to coveralls and link to GitHub. Add the
# repository you want to display, and copy the repo_token.
# The repo_token is what COVERALLS_TOKEN must be set to.
# - ENCRYPTION_LABEL:
# The file encryption mechanism of TravisCI is used to encrypt the private
# SSH key we need to push to the gh-pages branch of the repository. Follow
# the instructions on Travis:
# https://docs.travis-ci.com/user/encrypting-files/
# to install the `travis` executable. You can then run
# `travis encrypt-file -r sxs-collaboration/spectre deploy_key`
# replacing `sxs-collaboration/spectre` with whatever repo you want. Here
# `deploy_key` is the SSH key added to the GitHub repo's Deploy Keys
# (see the GitHub docs for info on deploy keys). Once you've run the
# `encrypt-file` command you will have two environment variables appear,
# `encrypted_${ENCRYPTION_LABEL}_iv` and
# `encrypted_${ENCRYPTION_LABEL}_key` where ${ENCRYPTION_LABEL} is an
# alpha-numerical combination that you will set the Travis
# `ENCRYPTION_LABEL` environment variable to (you'll need to add this
# variable manually).
#
# Cron Jobs:
# - Branch: develop, Interval: daily, Options: Always run
#
# Updating or adding new stages:
# - Make sure all stages are specified in the `stages:` section below that
# defines the order of the stages.
# - Make sure the stage names in the `jobs` section (using the `stage:` label)
# match exactly the names of the stages in the stage order section.
# - Make sure that all stages are accounted for in the `.travis/BuildLinux.sh`
# file. Note that the `${TRAVIS_BUILD_STAGE_NAME}` capitalizes only the first
# letter regardless of how you capitalize your stage names.
language: cpp
# To use Docker we need root access
sudo: required
services:
- docker
# Specify the order of stages.
stages:
- Build stage 1
- Build stage 2
- Build stage 3
- Build stage 4, ClangTidy, and Doxygen
# Set up travis configurations of Linux and macOS.
#
# We also have separate targets for running shell scripts that enforce what
# would normally be done as pre-push hooks, CHECK_COMMITS and CHECK_FILES
jobs:
fast_finish: true
include:
- stage: Build stage 4, ClangTidy, and Doxygen
os: linux
dist: trusty
env: CHECK_COMMITS=true
compiler: clang
name: check commits
- os: linux
dist: trusty
env: CHECK_FILES=true
compiler: clang
name: check files
- os: linux
dist: trusty
env: RUN_CLANG_TIDY=true BUILD_TYPE=Release
compiler: clang
name: clang-tidy release
- os: linux
dist: trusty
env: RUN_CLANG_TIDY=true BUILD_TYPE=Debug
compiler: clang
name: clang-tidy debug
- os: linux
dist: trusty
env: BUILD_DOC=true BUILD_TYPE=Debug
compiler: clang
name: documentation
- os: linux
dist: trusty
env: TEST_CHECK_FILES=true
compiler: clang
name: test check files
# Build stage 1
- &Gcc6Debug
os: linux
compiler: gcc-6
dist: trusty
env: BUILD_TYPE=Debug COMPILER=gcc-6
name: gcc-6 debug
stage: Build stage 1
- &Gcc6Release
os: linux
compiler: gcc-6
dist: trusty
env: BUILD_TYPE=Release COMPILER=gcc-6
name: gcc-6 release
- &Gcc7Debug
os: linux
compiler: gcc
dist: trusty
env: BUILD_TYPE=Debug COVERAGE=OFF COMPILER=gcc-7
name: gcc-7 debug
- &Gcc7Release
os: linux
compiler: gcc
dist: trusty
env: BUILD_TYPE=Release COMPILER=gcc-7
name: gcc-7 release
- &Gcc8Debug
os: linux
compiler: gcc-8
dist: trusty
env: BUILD_TYPE=Debug COMPILER=gcc-8
name: gcc-8 debug
- &Gcc8Release
os: linux
compiler: gcc-8
dist: trusty
env: BUILD_TYPE=Release COMPILER=gcc-8
name: gcc-8 release
- &Gcc9Debug
os: linux
compiler: gcc-9
dist: trusty
env: BUILD_TYPE=Debug COMPILER=gcc-9
name: gcc-9 debug
- &Gcc9Release
os: linux
compiler: gcc-9
dist: trusty
env: BUILD_TYPE=Release COMPILER=gcc-9
name: gcc-9 release
- &Clang4Debug
os: linux
compiler: clang-4.0
dist: trusty
env: BUILD_TYPE=Debug COMPILER=clang-4.0
name: clang-4 debug
- &Clang4Release
os: linux
compiler: clang-4.0
dist: trusty
env: BUILD_TYPE=Release COMPILER=clang-4.0
name: clang-4 release
- &Clang5Debug
os: linux
compiler: clang-5.0
dist: trusty
env: BUILD_TYPE=Debug COMPILER=clang-5.0
name: clang-5 debug
- &Clang5Release
os: linux
compiler: clang-5.0
dist: trusty
env: BUILD_TYPE=Release COMPILER=clang-5.0
name: clang-5 release
- &Clang8Debug
os: linux
compiler: clang-8
dist: trusty
env: BUILD_TYPE=Debug COMPILER=clang-8
name: clang-8 debug
- &Clang8Release
os: linux
compiler: clang-8
dist: trusty
env: BUILD_TYPE=Release COMPILER=clang-8
name: clang-8 release
# - &MacOsDebug9_2
# os: osx
# env: BUILD_TYPE=Debug
# osx_image: xcode9.2
# compiler: clang
# name: osx xcode 9.2 debug
# - &MacOsRelease9_2
# os: osx
# osx_image: xcode9.2
# env: BUILD_TYPE=Release
# compiler: clang
# name: osx xcode 9.2 release
# Build stage 2
- <<: *Gcc6Debug
stage: Build stage 2
- <<: *Gcc6Release
- <<: *Gcc7Debug
- <<: *Gcc7Release
- <<: *Gcc8Debug
- <<: *Gcc8Release
- <<: *Gcc9Debug
- <<: *Gcc9Release
- <<: *Clang4Debug
- <<: *Clang4Release
- <<: *Clang5Debug
- <<: *Clang5Release
- <<: *Clang8Debug
- <<: *Clang8Release
# Build stage 3
- <<: *Gcc6Debug
stage: Build stage 3
- <<: *Gcc6Release
- <<: *Gcc7Debug
- <<: *Gcc7Release
- <<: *Gcc8Debug
- <<: *Gcc8Release
- <<: *Gcc9Debug
- <<: *Gcc9Release
- <<: *Clang4Debug
- <<: *Clang4Release
- <<: *Clang5Debug
- <<: *Clang5Release
- <<: *Clang8Debug
- <<: *Clang8Release
# Last stage: Build stage 4, clang tidy, and docs.
- <<: *Gcc6Debug
stage: Build stage 4, ClangTidy, and Doxygen
- <<: *Gcc6Release
- <<: *Gcc7Debug
- <<: *Gcc7Release
- <<: *Gcc8Debug
- <<: *Gcc8Release
- <<: *Gcc9Debug
- <<: *Gcc9Release
- <<: *Clang4Debug
- <<: *Clang4Release
- <<: *Clang5Debug
- <<: *Clang5Release
- <<: *Clang8Debug
- <<: *Clang8Release
# Travis allows caching of data between builds to reduce build times or perform
# regression testing. We use ccache (https://ccache.samba.org/) to reduce
# compilation time.
#
# We cache the homebrew bottles (these are the downloaded compile copies of
# software). The reason isn't that the downloads take too long but that
# sometimes the download fails and then brew tries to build from source.
#
# We store manually installed dependencies such as LIBXSMM, Charm, Blaze,
# etc. in $HOME/mac_cache (on macOS builds). This is essential for both reducing
# the amount of time we spend building dependencies and for ensuring ccache
# works. If we rebuild the dependencies then ccache might think that are objects
# are out-of-date because they include a "newer" version of a header file.
#
# Unfortunately we have not yet had any success with getting ccache working on
# macOS either with or without a precompiled header and so have needed to
# disable macOS builds.
cache:
directories:
- $HOME/Library/Caches/Homebrew
- $HOME/mac_cache
- $HOME/ccache
# For macOS we install all dependencies in the before_install step of Travis.
# Unfortunately installing ccache and jemalloc from brew causes a brew update,
# which is extremely slow. For some reason ccache isn't building correctly when
# cloned and installed. The minimum version of macOS is set to 10.11 to avoid
# linking errors. All dependencies are installed into the home directory.
# ccache is used to reduce build times.
before_install:
- export CHARM_VERSION=6.8.0
- export BLAZE_VERSION=3.2
- export HDF5_VERSION=1.8.17
- export NUMPY_VERSION=1.14
- export SPECTRE_MIN_MACOS=-mmacosx-version-min=10.11
- export DEP_CACHE=$HOME/mac_cache
- export CHARM_PATCH=v6.8.patch
- export CHARM_CC=${CC}
- export FC=gfortran-8
- export USE_PCH=ON;
- if [[ ${COMPILER} =~ (gcc|clang)-([0-9\.]+) ]]; then
CC=${BASH_REMATCH[1]}-${BASH_REMATCH[2]};
if [[ ${BASH_REMATCH[1]} = gcc ]]; then
CXX=g++-${BASH_REMATCH[2]};
FC=gfortran-${BASH_REMATCH[2]};
else
CXX=clang++-${BASH_REMATCH[2]};
fi
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
./.travis/MacOsBuildDependencies.sh;
fi
# We use different configs for Linux and macOS. For Linux we use a Docker
# container to build SpECTRE, and build natively on macOS.
# The ENCRYPTED_KEY_VAR and ENCRYPTED_IV_VAR are used to retrieve the encrypted
# variables from TravisCI without showing the encrypt ID (which could be public
# without losing much, if any security). The COVERALLS_TOKEN is a
# secret env variable set in the TravisCI configuration.
#
# Linux:
# Use the folder ${HOME}/docker to hold the directories we need copied into the
# Docker image and also the Dockerfiles that are in the `containers` directory
# of the repo. The initial directory is inside the ${TRAVIS_BUILD_DIR}. We move
# the repo into the docker directory, and then copy in cached files. The
# known_hosts is copied in so that the image has push access to gh-pages in
# a secure manner. The GH_PAGES variables are used for automatic deployment of
# documentation to GitHub pages. We compile with -march=x86-64 because Travis
# puts us on different hardware sometimes and that breaks ccache if we use
# -march=native.
#
# macOS:
# The variable ${TRAVIS_BUILD_DIR} points to the cloned repository, not what
# we would normally call the build dir, but actually the source dir.
#
# What's the deal with all the &&?
# TravisCI only sees the return code of the last command executed inside the
# if block so a && between all the commands to execute returns the and of all
# the results. Thus, if any individual step fails, the build is failed.
script:
- ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
- ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
- export UPSTREAM_REPO="https://github.com/sxs-collaboration/spectre.git"
- export UPSTREAM_BRANCH="develop"
- export GH_PAGES_REPO="git@github.com:sxs-collaboration/spectre.git"
- export GH_PAGES_SOURCE_BRANCH="develop"
- export CXXFLAGS="-Werror -march=x86-64"
- if [ "$BUILD_TYPE" == "Debug" ]; then
export CXXFLAGS="$CXXFLAGS -DBLAZE_USE_VECTORIZATION=0";
fi
- printenv
- if [ "${CHECK_COMMITS}" == "true" ]; then
./tools/CheckCommits.sh;
elif [ "${CHECK_FILES}" == "true" ]; then
./tools/CheckFiles.sh;
elif [ "${TEST_CHECK_FILES}" == "true" ]; then
./tools/CheckFiles.sh --test;
elif [ "${TRAVIS_OS_NAME}" == "linux" ]; then
if [ ! -d ${HOME}/ccache/build_${CC}_${BUILD_TYPE} ]; then
mkdir ${HOME}/ccache/build_${CC}_${BUILD_TYPE};
fi;
cp -vr containers ${HOME}/docker
&& cd ${HOME}
&& mv -v ${TRAVIS_BUILD_DIR} ${HOME}/docker/spectre
&& rm -rf ${HOME}/docker/ccache
&& mv ${HOME}/ccache/build_${CC}_${BUILD_TYPE} ${HOME}/docker/ccache
&& cp ${HOME}/.ssh/known_hosts ${HOME}/docker/known_hosts
&& docker build
--build-arg CXXFLAGS="${CXXFLAGS}"
--build-arg COVERAGE=${COVERAGE}
--build-arg BUILD_TYPE=${BUILD_TYPE}
--build-arg CC=${CC}
--build-arg CXX=${CXX}
--build-arg FC=${FC}
--build-arg CHARM_CC=${CHARM_CC}
--build-arg TRAVIS_BRANCH=${TRAVIS_BRANCH}
--build-arg TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
--build-arg TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}
--build-arg TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
--build-arg TRAVIS_TAG=${TRAVIS_TAG}
--build-arg TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}
--build-arg TRAVIS_COMMIT=${TRAVIS_COMMIT}
--build-arg TRAVIS_SECURE_ENV_VARS=${TRAVIS_SECURE_ENV_VARS}
--build-arg TRAVIS_EVENT_TYPE=${TRAVIS_EVENT_TYPE}
--build-arg TRAVIS_BUILD_STAGE_NAME="${TRAVIS_BUILD_STAGE_NAME}"
--build-arg ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
--build-arg ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
--build-arg GH_PAGES_REPO=${GH_PAGES_REPO}
--build-arg GH_PAGES_SOURCE_BRANCH=${GH_PAGES_SOURCE_BRANCH}
--build-arg COVERALLS_TOKEN=${COVERALLS_TOKEN}
--build-arg RUN_CLANG_TIDY=${RUN_CLANG_TIDY}
--build-arg BUILD_DOC=${BUILD_DOC}
--build-arg USE_PCH=${USE_PCH}
--build-arg UPSTREAM_REPO=${UPSTREAM_REPO}
--build-arg UPSTREAM_BRANCH=${UPSTREAM_BRANCH}
--build-arg CHARM_PATCH=${CHARM_PATCH}
--build-arg CORE_LIBS=${CORE_LIBS}
-t ${TRAVIS_REPO_SLUG}
-f ${HOME}/docker/Dockerfile.travis
${HOME}/docker/
&& rm -rf ${HOME}/ccache/build_${CC}_${BUILD_TYPE}
&& CON=$(docker run -d ${TRAVIS_REPO_SLUG} /bin/bash)
&& docker cp ${CON}:/root/.ccache ${HOME}/ccache/build_${CC}_${BUILD_TYPE}/
&& docker cp ${CON}:/work/build_${BUILD_TYPE}_${CC}/tmp/coverage.info
${HOME}/docker/spectre;
elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
${TRAVIS_BUILD_DIR}/.travis/MacOsBuild.sh;
else
echo "Unknown build environment"
&& exit -1;
fi
# After a successful build the results are pushed to codecov.io, which doesn't
# use a token but instead tracks the repository name on GitHub. This allows it
# to report before being merged instead of after merging like Coveralls.
after_success:
- if [ ${TRAVIS_OS_NAME} = linux ]
&& [ ${CC} = gcc ]
&& [ ${COVERAGE} = ON ]; then
cd ${HOME}/docker/spectre;
bash <(curl -s https://codecov.io/bash) ||
echo "Codecov did not collect coverage reports";
fi
# Generated using instructions from:
# https://docs.travis-ci.com/user/notifications/#Slack-notifications
notifications:
slack:
secure: PntVovViQom/qkRd7K1wne6ji+3hn67bnrrfRZJ03LYk0PQUBgjNAQQAwEYqGOGeLlCEcKz1rQljUGaYFP5DYtu5BsXeWenSXbNElwfVivzHtEBdS9v4BnB4C0aD5hG2fzXhsbm4bAEq+fTfmyvHTbC8f7pHUV9zfJv4+yTjR0YW+0lYgtODqpxqEGC+f07RwkbsODO87yrZT9oPWZ8Q7a7ZECKcdv38oaBzN3cnHjFXsWTRYTu672FtBKefRohpS01UrobJNAM0L7Bl1huoP52rMw34J6Nl47u+upP/t/iPHi68lk8/0hRf0z+KgOYLSgGb5wwPfNQ9rrOfA1YTjCgVoyj/3pszP6mcVfXN40+5tjww7/RXsuQ+WsbEhOs9Z1cDAdPA0cd3pVb3Iv4an07htNfhLnaATtDe22BbuWD16LCUz/xVrq5XwWtE172EYWk7wyUZd8iofGXLLu/tVLs4lwZG/z1cF4wShpxhK3eXH3V4Y1wR7afpkzTN+z5Y4z5ObqDVMfydg79F4coaH0ky5K30Wf4n9TQ2yaDXIP3yepXBlpY1zXM0Ygmu9W2P5PCd79E5lWoWXoWwa90KmcOeuZ/CSbotHLCiAtzoDHjR70TOkPqEpGmnUubwhcYDnoNXv634FvZvExd97LeAuOlD9xcLUQRQKABVvj04S4k=