forked from ecmwf/eckit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
208 lines (182 loc) · 6.22 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
language: cpp
cache:
directories:
- ${HOME}/deps/cmake
# - ${HOME}/deps/openmpi
# - ${HOME}/deps/mpich
jobs:
include:
- os: linux
arch: amd64
compiler: clang
env:
- CACHE_NAME=linux-clang38
- CXX_COMPILER='clang++-3.8' C_COMPILER='clang-3.8'
- ECKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_EXPERIMENTAL=OFF -DENABLE_MPI=OFF"
addons:
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8']
- os: linux
arch: ppc64le
compiler: clang
env:
- CACHE_NAME=linux-clang38
- CXX_COMPILER='clang++-3.8' C_COMPILER='clang-3.8'
- ECKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_EXPERIMENTAL=OFF -DENABLE_MPI=OFF"
- ECKIT_CTEST_OPTIONS="-E eckit_test_memory_mmap"
addons:
apt:
sources: ['llvm-toolchain-precise', 'ubuntu-toolchain-r-test']
packages: ['clang-3.8']
- os: linux
arch: amd64
compiler: gcc
env:
- CACHE_NAME=linux-gcc5
- CXX_COMPILER='g++-5' C_COMPILER='gcc-5'
- ECKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_EXPERIMENTAL=OFF -DENABLE_MPI=OFF"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'gcc-5']
- os: linux
arch: ppc64le
compiler: gcc
env:
- CACHE_NAME=linux-gcc5
- CXX_COMPILER='g++-5' C_COMPILER='gcc-5'
- ECKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_EXPERIMENTAL=OFF -DENABLE_MPI=OFF"
- ECKIT_CTEST_OPTIONS="-E eckit_test_memory_mmap"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'gcc-5']
- os: linux
arch: amd64
compiler: gcc
env:
- CACHE_NAME=linux-gcc7
- CXX_COMPILER='g++-7' C_COMPILER='gcc-7'
- ECKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_EXPERIMENTAL=OFF -DENABLE_GPROF=ON -DENABLE_MPI=OFF"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'gcc-7']
- os: linux
arch: ppc64le
compiler: gcc
env:
- CACHE_NAME=linux-gcc7
- CXX_COMPILER='g++-7' C_COMPILER='gcc-7'
- ECKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_EXPERIMENTAL=OFF -DENABLE_MPI=OFF"
- ECKIT_CTEST_OPTIONS="-E eckit_test_memory_mmap"
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'gcc-7']
- os: osx
env:
- CACHE_NAME=osx-clang
- CXX_COMPILER='clang++' C_COMPILER='clang'
- ECKIT_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=DEBUG -DENABLE_EXPERIMENTAL=OFF -DENABLE_MPI=OFF"
osx_image: xcode12
before_install:
# Fixes to pre-installed packages
# - |
# ### Fix pre-installed packages
# if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# brew update
# brew list oclint || brew cask uninstall oclint # Prevent conflict with gcc
# fi
# Set compilers
- |
### Set compilers
export CC=${C_COMPILER}
export CXX=${CXX_COMPILER}
install:
# All dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR=${HOME}/deps
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
# Install compilers if needed -- only for fortran
# - |
# ### Install gcc (homebrew)
# if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# brew upgrade gcc || brew install gcc
# fi
# # Install MPI
# - |
# ### Install MPI
# install-mpi.sh ${MPI}
# source ${DEPS_DIR}/${MPI}/env.sh
# echo "${MPI_HOME}"
# echo "${PATH}"
# Install CMake
- |
### Install CMake
#sudo apt-get install libuv1-dbg libuv1-dev libuv1 rhash libstdc++6;
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_VERSION=3.18.4
if [[ -z "$(ls -A ${DEPS_DIR}/cmake)" ]]; then
if [[ "${TRAVIS_ARCH}" == "amd64" ]]; then
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-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
if [[ "${TRAVIS_ARCH}" = "ppc64le" ]]; then
# Build from source
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}.tar.gz"
mkdir -p ${DEPS_DIR}/cmake-source && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake-source
(
cd ${DEPS_DIR}/cmake-source
mkdir -p build && cd build
../bootstrap --prefix=${DEPS_DIR}/cmake && make -j4 install
)
fi
else
echo "CMake already found in cache"
fi
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew upgrade cmake || brew install cmake
brew install openssl
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
fi
cmake --version
# Install ecbuild
- |
### Install ecbuild
git clone --depth 1 -b develop https://github.com/ecmwf/ecbuild ${DEPS_DIR}/ecbuild
export ecbuild_ROOT=${DEPS_DIR}/ecbuild
${ecbuild_ROOT}/bin/ecbuild --version
script:
# Environment variables
- echo ${CXX}
- echo ${CC}
# - echo ${FC}
# - echo ${MPI_HOME}
- echo ${PATH}
- |
ECKIT_SOURCE_DIR=${TRAVIS_BUILD_DIR}
ECKIT_BUILD_DIR=${TRAVIS_BUILD_DIR}/builds/eckit
# build eckit
- mkdir -p ${ECKIT_BUILD_DIR} && cd ${ECKIT_BUILD_DIR}
- cmake ${ECKIT_CMAKE_OPTIONS} ${ECKIT_SOURCE_DIR}
- make -j4
- bin/eckit-version
# test eckit
- ctest ${ECKIT_CTEST_OPTIONS}
after_success:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
# Creating report
cd ${ECKIT_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 33404098-c4e6-4701-a89c-36f33ceb3795 || echo "Codecov did not collect coverage reports"
fi
after_failure:
- cd ${ECKIT_BUILD_DIR}
- ctest -VV --rerun-failed ${ECKIT_CTEST_OPTIONS}
- cat ecbuild.log