-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
251 lines (212 loc) · 9.94 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
#TODO: precache could be done only with one job, but the compiled libs would need to be uploaded to some external storage (wizard? ams s3?);
# then a problem with secure storage of credentials appears - they could be stored in encrypted env vars on travis, but that would make it impossible to start PRs from forked repos;
# add an additional compile stage with jobs only for different os/compilers, not env vars (needs external storage as well)
# example of a hack how to share cache among different jobs (might mean we do not need external storage):
# - https://github.com/travis-ci/travis-ci/issues/7590
# - https://github.com/qTox/qTox/blob/59b5578c7bffc56f6227c60bfcb38f97d39ec8d9/.travis.yml
stages:
- precache
- test
language: cpp
os:
- linux
# - osx
dist: xenial
compiler:
- gcc
- clang
env:
# - MPI=none
# - MPI=openmpi
# not supported by Boost.MPI in Debian on amd64:
# - MPI=lam
# - MPI=mpich
- TEST_SUITE=unit MPI=none
- TEST_SUITE=sandbox MPI=none
- TEST_SUITE=paper MPI=none
- TEST_SUITE=elliptic_drop MPI=none
- TEST_SUITE=nair_jablonowski_2008 MPI=none
- TEST_SUITE=UWLCM_MT MPI=none
- TEST_SUITE=UWLCM_unit_iles MPI=none
- TEST_SUITE=UWLCM_unit_smg MPI=none
- TEST_SUITE=pbl MPI=none
- TEST_SUITE=osx_local_clang MPI=none
- TEST_SUITE=unit MPI=mvapich2
- TEST_SUITE=sandbox MPI=mvapich2
# MPI paper tests don't do file comparison and plotting; TODO: fix them
- TEST_SUITE=paper MPI=mvapich2
- TEST_SUITE=elliptic_drop MPI=mvapich2
# disabled, because polar bconds dont work with MPI
# - TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
- TEST_SUITE=pbl MPI=mvapich2
# bconds_div has to be ran separately with mpi because of timeouts
- TEST_SUITE=bconds_div MPI=mvapich2
# TODO: once libcloud MPI works, turn UWLCM MPI test on
# - TEST_SUITE=UWLCM MPI=mvapich2
cache:
packages: true
pip: true
directories:
- ${TRAVIS_BUILD_DIR}/deps/mvapich2-2.3b
- ${TRAVIS_BUILD_DIR}/deps/boost
- ${TRAVIS_BUILD_DIR}/deps/hdf5
- /home/travis/.rvm/ # following Travis cache documentation: try to cache installed ruby on osx
# define the precache stage
# empty phases mean that default phases (before_install, install, ...) from the test stage are used (?)
# TODO: precache stage has a lot of unnecessary before_install and install code common to the (default) test stage;
# add after_success, after_failure to precache, remove building of caches from the test stage, make the build error instead;
# YAML alias for the options common to precache jobs
aliases:
- &precache_default
stage: precache
install:
- . ./.travis_scripts/deps_install/install_common.sh
script: echo "Preparing cache finished"
jobs:
include:
- <<: *precache_default
env: TEST_SUITE=unit MPI=mvapich2
- <<: *precache_default
env: TEST_SUITE=sandbox MPI=mvapich2
- <<: *precache_default
env: TEST_SUITE=paper MPI=mvapich2
- <<: *precache_default
env: TEST_SUITE=elliptic_drop MPI=mvapich2
- <<: *precache_default
env: TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
- <<: *precache_default
env: TEST_SUITE=pbl MPI=mvapich2
- <<: *precache_default
env: TEST_SUITE=bconds_div MPI=mvapich2
# excluded jobs
exclude:
# MPI with clang disabled due to difficulties with building boost with clang
- compiler: clang
env: TEST_SUITE=unit MPI=mvapich2
- compiler: clang
env: TEST_SUITE=sandbox MPI=mvapich2
- compiler: clang
env: TEST_SUITE=paper MPI=mvapich2
- compiler: clang
env: TEST_SUITE=elliptic_drop MPI=mvapich2
- compiler: clang
env: TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
- compiler: clang
env: TEST_SUITE=pbl MPI=mvapich2
- compiler: clang
env: TEST_SUITE=bconds_div MPI=mvapich2
- os: osx
env: TEST_SUITE=pbl MPI=none # pbl not tested on osx
- os: osx
compiler: gcc
- compiler: clang
env: TEST_SUITE=UWLCM_MT MPI=none
- compiler: clang
env: TEST_SUITE=UWLCM_unit_iles MPI=none
- compiler: clang
env: TEST_SUITE=UWLCM_unit_smg MPI=none
# local clang tests on osx
- os: linux
env: TEST_SUITE=osx_local_clang MPI=none
- compiler: gcc
env: TEST_SUITE=osx_local_clang MPI=none
addons:
apt:
packages:
- g++-6
- clang-5.0
- python3-pip
- python3-setuptools
sources: &sources
- sourceline: 'ppa:rakhimov/boost'
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial
before_install:
# define a compiler variable for use in if statements
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'clang++' ]]; then export COMPILER=clang++; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export COMPILER=g++; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export COMPILER=clang++; fi # only clang on osx
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t xenial -y"; fi
# gnuplot-iostream
- git clone -n https://github.com/dstahlke/gnuplot-iostream && cd gnuplot-iostream
- git checkout 8b6e30c6ea5ee4f07ccf90d858d35a10cf67a3e2 # later commits require c++17
- sudo cp gnuplot-iostream.h /usr/local/include/gnuplot-iostream.h
- cd ..
# needed to get rvm, see below
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then \curl -sSL https://get.rvm.io | bash -s -- --branch stable; fi
# https://github.com/travis-ci/travis-ci/issues/10165
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm reload; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm list known; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm install ruby-2.6; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm use 2.6; fi
# locally installed stuff comes first
- export PATH=/usr/local/bin:$PATH
# fixing broken OSX gzip tools
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gzip; fi
# to avoid problems with plotting by paraview on Travis
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then unset DISPLAY; fi
- export make_j="make -j 4"
# testing Python 3 on Linux
- export PY3DEB=""
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then PY3DEB=3; fi
# upgrade pip
- sudo pip$PY3DEB install --upgrade pip
install:
- . ./.travis_scripts/deps_install/install_common.sh
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install hdf5; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gnuplot-nox; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi
# Python modules
# make Python 3 the default if requested
- if [[ $TRAVIS_OS_NAME == 'linux' && $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi
# h5py
- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI == 'none' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi
# build h5py with mpi support
#- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then sudo pip install mpi4py; fi
- |
if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then
sudo pip$PY3DEB install Cython # to generate the C wrappers
#sudo pip install https://bitbucket.org/mpi4py/mpi4py/get/master.tar.gz
mkdir mpi4py
cd mpi4py
travis_retry wget --no-check-certificate --quiet -O - https://bitbucket.org/mpi4py/mpi4py/get/master.tar.gz | tar --strip-components=1 -xz
python setup.py build
sudo python setup.py install
cd ..
fi
# h5py uninstallation following https://github.com/h5py/h5py/issues/672
- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then sudo -H pip$PY3DEB uninstall h5py; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then HDF5_DIR=$HDF5_ROOT HDF5_MPI="ON" sudo -H pip$PY3DEB install --no-cache-dir --no-binary=h5py h5py; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install h5py; fi
# scipy
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-scipy; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install scipy; fi
# matplotlib
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-matplotlib; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install matplotlib; fi
script:
# libmpdata++
- cd libmpdata++
- mkdir build
- cd build
- cmake ..
- cd ../..
# compiling and running all unit tests in Debug & Release modes
- if [[ $TEST_SUITE == 'unit' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars
# compiling and running selected paper tests in Debug mode
- if [[ $TEST_SUITE == 'paper' ]]; then . ./.travis_scripts/paper.sh; fi
# compiling all sandbox tests in Release mode
- if [[ $TEST_SUITE == 'sandbox' ]]; then . ./.travis_scripts/sandbox.sh; fi
- if [[ $TEST_SUITE == 'elliptic_drop' ]]; then . ./.travis_scripts/elliptic_drop.sh; fi
# UWLCM
- if [[ $TEST_SUITE == 'UWLCM_MT' ]]; then . ./.travis_scripts/UWLCM.sh moist_thermal; fi
- if [[ $TEST_SUITE == 'UWLCM_unit_iles' ]]; then . ./.travis_scripts/UWLCM.sh unit_iles; fi
- if [[ $TEST_SUITE == 'UWLCM_unit_smg' ]]; then . ./.travis_scripts/UWLCM.sh unit_smg; fi
# compiling and running tests from Nair & Jablonowski 2008 MWR paper in Release mode
- if [[ $TEST_SUITE == 'nair_jablonowski_2008' ]]; then . ./.travis_scripts/nair_jablonowski_2008.sh; fi
# running pbl tests in Release mode
- if [[ $TEST_SUITE == 'pbl' ]]; then . ./.travis_scripts/pbl.sh; fi
# running bconds_div tests in Release mode
- if [[ $TEST_SUITE == 'bcond_div' ]]; then . ./.travis_scripts/bconds_div.sh; fi
# testing local clang on osx
- if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars