-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
229 lines (194 loc) · 7.02 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
sudo: false
language: cpp
# Workaround for https://github.com/travis-ci/travis-ci/issues/4681
matrix:
- TRAVIS_EMPTY_JOB_WORKAROUND=true
cache:
directories:
- ${HOME}/deps/cmake
- ${HOME}/deps/openmpi
- ${HOME}/deps/mpich
- ${HOME}/deps/eckit
matrix:
exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND
include:
- os: linux
compiler: clang
env:
- CACHE_NAME=linux-clang38-mpich
- CXX_COMPILER='clang++-3.8' C_COMPILER='clang-3.8' Fortran_COMPILER='gfortran'
- MPI='mpich'
- FCKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG"
addons:
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8', 'gfortran']
- os: linux
compiler: gcc
env:
- CACHE_NAME=linux-gcc5-openmpi
- CXX_COMPILER='g++-5' C_COMPILER='gcc-5' Fortran_COMPILER='gfortran-5'
- MPI='openmpi'
- FCKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'gcc-5', 'gfortran-5']
- os: linux
compiler: gcc
env:
- CACHE_NAME=linux-gcc7-mpich
- CXX_COMPILER='g++-7' C_COMPILER='gcc-7' Fortran_COMPILER='gfortran-7'
- MPI='mpich'
- FCKIT_CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_GPROF=ON'
- COVERAGE=ON
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'gcc-7', 'gfortran-7', 'lcov']
- os: osx
env:
- CACHE_NAME=osx-clang-openmpi
- CXX_COMPILER='clang++' C_COMPILER='clang' Fortran_COMPILER='gfortran'
- MPI=openmpi
- FCKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG"
osx_image: xcode10.1
addons:
homebrew:
packages:
- openmpi
##################################
# KNOWN TO FAIL, so comment
##################################
# - os: osx
# env:
# - CACHE_NAME=osx-clang-mpich
# - CXX_COMPILER='clang++' C_COMPILER='clang' Fortran_COMPILER='gfortran'
# - MPI=mpich
# osx_image: xcode9
# - os: linux
# compiler: gcc
# env:
# - CACHE_NAME=linux-pgi-openmpi
# - CXX_COMPILER='pgc++' C_COMPILER='pgcc' Fortran_COMPILER='pgfortran'
# - MPI='openmpi'
# - PGI_VERSION="CommunityEdition"
# - ECKIT_CMAKE_OPTIONS="-DRT_LIB=/usr/lib/x86_64-linux-gnu/librt.so -DCURSES_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurses.so"
# - FCKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_FORTRAN=OFF" # Fortran tests known to be broken with pgi/17.10
before_install:
#################################################################
# Set compilers
#################################################################
- |
### Set compilers
export CC=${C_COMPILER}
export CXX=${CXX_COMPILER}
export FC=${Fortran_COMPILER}
- |
### Load scripts
source ${TRAVIS_BUILD_DIR}/tools/source-me.sh
install:
#################################################################
# All dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
#################################################################
- DEPS_DIR=${HOME}/deps
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- |
DEPS_BRANCH="master"
if [[ "${TRAVIS_BRANCH}" != "master" ]]; then
DEPS_BRANCH="develop"
fi
#################################################################
# Install Compilers
#################################################################
- |
### Install gcc (homebrew)
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export HOMEBREW_NO_AUTO_UPDATE=1
brew install gcc
brew link gcc
fi
- |
### Install PGI community edition
if [[ "${PGI_VERSION:-notset}" == "CommunityEdition" ]]; then
install-pgi.sh --mpi --prefix ${DEPS_DIR}/pgi
source ${DEPS_DIR}/pgi/env.sh
fi
#################################################################
# Install MPI
#################################################################
- |
### Install MPI
install-mpi.sh ${MPI}
source ${DEPS_DIR}/${MPI}/env.sh
echo "${MPI_HOME}"
echo "${PATH}"
#################################################################
# Install CMake
#################################################################
- |
### Install CMake
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ -z "$(ls -A ${DEPS_DIR}/cmake)" ]]; then
CMAKE_URL="https://cmake.org/files/v3.13/cmake-3.13.3-Linux-x86_64.tar.gz"
mkdir -p ${DEPS_DIR}/cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake
fi
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
fi
cmake --version
#################################################################
# Install ecbuild
#################################################################
- |
### Install ecbuild
git clone --depth 1 -b ${DEPS_BRANCH} https://github.com/ecmwf/ecbuild ${DEPS_DIR}/ecbuild
export PATH=${DEPS_DIR}/ecbuild/bin:${PATH}
export ECBUILD_MODULE_PATH=${DEPS_DIR}/ecbuild/cmake
ecbuild --version
#################################################################
# Install eckit
#################################################################
- |
### Install eckit
install-dep.sh --repo eckit --branch ${DEPS_BRANCH} --prefix ${DEPS_DIR}/eckit --cmake "-DENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=DEBUG ${ECKIT_CMAKE_OPTIONS}"
- export ECKIT_PATH=${DEPS_DIR}/eckit
- ${DEPS_DIR}/eckit/bin/eckit-version
script:
#################################################################
# Environment variables
#################################################################
- echo ${CXX}
- echo ${CC}
- echo ${FC}
- echo ${MPI_HOME}
- echo ${PATH}
- |
FCKIT_SOURCE_DIR=${TRAVIS_BUILD_DIR}
FCKIT_BUILD_DIR=${TRAVIS_BUILD_DIR}/builds/fckit
#################################################################
# Build fckit
#################################################################
- mkdir -p ${FCKIT_BUILD_DIR} && cd ${FCKIT_BUILD_DIR}
- cmake -DCMAKE_MODULE_PATH=${ECBUILD_MODULE_PATH} ${FCKIT_CMAKE_OPTIONS} ${FCKIT_SOURCE_DIR}
- make -j4
- bin/fckit --info
#################################################################
# Test fckit
#################################################################
- ctest
after_success:
- |
if [[ "${COVERAGE}" == "ON" ]]; then
# Creating report
cd ${FCKIT_BUILD_DIR}
lcov --directory . --capture --output-file coverage.info # capture coverage info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
lcov --list coverage.info #debug info
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -t d604c898-35ae-4ce6-ad24-a4c0d56c2afc || echo "Codecov did not collect coverage reports"
fi
after_failure:
- cd ${FCKIT_BUILD_DIR}
- ctest -VV --rerun-failed
- cat ecbuild.log