forked from openPMD/openPMD-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
executable file
·215 lines (210 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
209
210
211
212
213
214
215
sudo: required
dist: trusty
cache:
apt: true
directories:
- $HOME/.cache/spack
pip: true
env:
global:
- BUILD: ~/buildTmp
- CXXFLAGS: "-std=c++11 -Wall -Wextra -Woverloaded-virtual -Wshadow"
- SPACK_ROOT: $HOME/.cache/spack
- PATH: $PATH:$HOME/.cache/spack/bin
addons:
apt:
&apt_common_sources
sources:
- ubuntu-toolchain-r-test
jobs:
fast_finish: true
include:
###########################################################################
# Stage: Style #
###########################################################################
- &style_python
stage: 'Style'
language: python
python: "2.7"
install: pip install -U flake8
script:
# Test Python Files for PEP8 conformance
- flake8 --exclude=thirdParty .
- <<: *style_python
python: "3.6"
# TODO: C++ clang-format checks
###########################################################################
# Stage: Static Code Analysis #
###########################################################################
- &static_code_python
stage: 'Static Code Analysis'
language: python
python: "2.7"
install: pip install -U pyflakes
script:
# Warnings, unused code, etc.
- pyflakes .
- <<: *static_code_python
python: "3.6"
###########################################################################
# Stage: C++ Unit Tests #
###########################################################################
# Clang 5.0.0
- &test-cpp-unit
stage: 'C++ Unit Tests'
language: cpp
env:
- USE_MPI=OFF USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF
compiler: clang
addons:
apt:
<<: *apt_common_sources
packages: &clang50_deps
- gfortran-4.9
- g++-4.9 # CMake build
before_install: &clang50_init
- COMPILERSPEC="%[email protected]"
script: &script-cpp-unit
- mkdir -p $HOME/build
- cd $HOME/build
- if [ ! -d samples/git-sample/ ]; then
$TRAVIS_BUILD_DIR/.travis/download_samples.sh;
fi
- CXXFLAGS=$CXXFLAGS CXX=$CXX CC=$CC
cmake
-DCMAKE_BUILD_TYPE=Debug
-DopenPMD_USE_MPI=$USE_MPI
-DopenPMD_USE_HDF5=$USE_HDF5
-DopenPMD_USE_ADIOS1=$USE_ADIOS1
-DopenPMD_USE_ADIOS2=$USE_ADIOS2
-DCMAKE_INSTALL_PREFIX=$HOME/openPMD-test-install
$TRAVIS_BUILD_DIR
- make -j 2
- CTEST_OUTPUT_ON_FAILURE=1 make test
- make install
# - make package
# - dpkg -i openPMD*.deb
- <<: *test-cpp-unit
env:
- USE_MPI=ON USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF
compiler: clang
addons:
apt:
<<: *apt_common_sources
packages:
- *clang50_deps
- libopenmpi-dev
- openmpi-bin
before_install: *clang50_init
script: *script-cpp-unit
# GCC 4.9.4
- <<: *test-cpp-unit
env:
- USE_MPI=OFF USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages: &gcc49_deps
- gfortran-4.9
- gcc-4.9
- g++-4.9
before_install: &gcc49_init
- CXX=g++-4.9 && CC=gcc-4.9 && COMPILERSPEC="%[email protected]"
script: *script-cpp-unit
- <<: *test-cpp-unit
env:
- USE_MPI=ON USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages:
- *gcc49_deps
- libopenmpi-dev
- openmpi-bin
before_install: *gcc49_init
script: *script-cpp-unit
# GCC 6.3.0
- <<: *test-cpp-unit
env:
- USE_MPI=OFF USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages: &gcc63_deps
- gfortran-6
- gcc-6
- g++-6
before_install: &gcc63_init
- CXX=g++-6 && CC=gcc-6 && COMPILERSPEC="%[email protected]"
script: *script-cpp-unit
- <<: *test-cpp-unit
env:
- USE_MPI=ON USE_HDF5=ON USE_ADIOS1=OFF USE_ADIOS2=OFF
compiler: gcc
addons:
apt:
<<: *apt_common_sources
packages:
- *gcc63_deps
- libopenmpi-dev
- openmpi-bin
before_install: *gcc63_init
script: *script-cpp-unit
allow_failures:
- compiler: clang
install:
# spack install
- SPACK_FOUND=$(which spack >/dev/null && { echo 0; } || { echo 1; })
- if [ $SPACK_FOUND -ne 0 ]; then
mkdir -p $SPACK_ROOT &&
git clone --depth 50 https://github.com/spack/spack.git $SPACK_ROOT;
fi
# spack setup
- cp $TRAVIS_BUILD_DIR/.travis/spack/*.yaml
$SPACK_ROOT/etc/spack/
- spack bootstrap
- source /etc/profile &&
source $SPACK_ROOT/share/spack/setup-env.sh
- SPACK_VAR_MPI="~mpi";
# required dependencies - CMake 3.10.0 & Boost 1.62.0
- travis_wait spack install
[email protected]~openssl~ncurses
$COMPILERSPEC
- spack load [email protected] $COMPILERSPEC
- travis_wait spack install
$COMPILERSPEC
- spack load [email protected] $COMPILERSPEC
# optional dependencies - MPI, HDF5, ADIOS1, ADIOS2
- if [ $USE_MPI == "ON" ]; then
travis_wait spack install
$COMPILERSPEC &&
spack load [email protected] $COMPILERSPEC;
SPACK_VAR_MPI="+mpi";
fi
- if [ $USE_HDF5 == "ON" ]; then
travis_wait spack install
hdf5
$SPACK_VAR_MPI
$COMPILERSPEC &&
spack load hdf5 $SPACK_VAR_MPI $COMPILERSPEC;
fi
- if [ $USE_ADIOS1 == "ON" ]; then
travis_wait spack install
adios
$SPACK_VAR_MPI
$COMPILERSPEC &&
spack load adios $SPACK_VAR_MPI $COMPILERSPEC;
fi
- if [ $USE_ADIOS2 == "ON" ]; then
travis_wait spack install
adios2
$SPACK_VAR_MPI
$COMPILERSPEC &&
spack load adios2 $SPACK_VAR_MPI $COMPILERSPEC;
fi
- spack clean -a