-
Notifications
You must be signed in to change notification settings - Fork 160
389 lines (325 loc) · 10.7 KB
/
ci.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
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
name: HighFive_CI
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- main
- v2.x
pull_request:
branches:
- master
- main
- v2.x
paths-ignore:
- '**.md'
- '**.rst'
- 'doc/**'
env:
HOMEBREW_NO_AUTO_UPDATE: 1 # for reproducibility, dont autoupdate
BUILD_TYPE: RelWithDebInfo
INSTALL_DIR: install
jobs:
# Job testing compiling on several Ubuntu systems + MPI
# =========================================================
#
# For 20.04: bare and activate Boost, OpenCV
# For latest: activate Boost, Eigen, OpenCV, with Ninja
#
# XTensor tests are run for conda/mamba and MacOS
Linux_MPI:
runs-on: ${{matrix.config.os}}
name: Linux_MPI (${{toJson(matrix.config)}})
strategy:
matrix:
include:
- config:
os: ubuntu-20.04
pkgs: ''
- config:
os: ubuntu-20.04
pkgs: 'libboost-all-dev libopencv-dev'
flags: '-DHIGHFIVE_TEST_BOOST:Bool=ON -DHIGHFIVE_TEST_OPENCV:Bool=ON -GNinja'
- config:
os: ubuntu-latest
pkgs: 'libboost-all-dev libeigen3-dev libopencv-dev'
flags: '-DHIGHFIVE_TEST_BOOST:Bool=ON -DHIGHFIVE_TEST_EIGEN:Bool=ON -DHIGHFIVE_TEST_OPENCV:Bool=ON -GNinja'
- config:
os: ubuntu-20.04
pkgs: 'libboost-all-dev'
flags: '-DCMAKE_CXX_STANDARD=17 -DHIGHFIVE_TEST_BOOST:Bool=ON'
- config:
os: ubuntu-22.04
flags: '-DHIGHFIVE_TEST_BOOST=Off -DCMAKE_CXX_STANDARD=20'
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: "Setup MPI"
uses: mpi4py/setup-mpi@v1
with:
mpi: openmpi
- name: "Install libraries"
run: |
sudo apt-get -qq update
sudo apt-get -qq install libhdf5-openmpi-dev libsz2 ninja-build ${{ matrix.config.pkgs }}
- name: Build
run: |
CMAKE_OPTIONS=(-DHIGHFIVE_PARALLEL_HDF5:BOOL=ON ${{ matrix.config.flags }})
source $GITHUB_WORKSPACE/.github/build.sh
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -j2 --output-on-failure -C $BUILD_TYPE
- name: Test No HDF5 Diagnositics
working-directory: ${{github.workspace}}/build
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
# Job testing several versions of hdf5
# ===================================================
Linux_HDF5_Versions:
runs-on: ubuntu-latest
strategy:
matrix:
hdf5_version : [ hdf5-1_8_23, hdf5-1_10_11, hdf5-1_12_3, hdf5-1_14_3 ]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: "Install libraries"
run: |
sudo apt-get -qq update
sudo apt-get -qq install ninja-build libsz2 zlib1g-dev libboost-all-dev
- name: Build HDF5
run: |
wget https://github.com/HDFGroup/hdf5/archive/refs/tags/${{ matrix.hdf5_version }}.tar.gz --output-document hdf5.tar.gz
tar xf hdf5.tar.gz
mkdir -p hdf5-${{ matrix.hdf5_version }}/BUILD && cd hdf5-${{ matrix.hdf5_version }}/BUILD
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.hdf5_version }} -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DUSE_LIBAEC=ON -DHDF5_BUILD_EXAMPLES=OFF -DBUILD_STATIC_LIBS=OFF -DBUILD_TESTING=OFF
ninja && ninja install
- name: Build
run: |
CMAKE_OPTIONS=(
-GNinja
-DHDF5_ROOT=$HOME/${{ matrix.hdf5_version }}
)
source $GITHUB_WORKSPACE/.github/build.sh
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -j2 --output-on-failure -C $BUILD_TYPE
- name: Test No HDF5 Diagnositics
working-directory: ${{github.workspace}}/build
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
run: $GITHUB_WORKSPACE/.github/run_examples.sh
# Job testing several compilers on a stable Linux
# ====================================================
Linux_Compilers:
runs-on: ubuntu-20.04
strategy:
matrix:
env: [
{CC: clang-10, CXX: clang++-10},
{CC: clang-12, CXX: clang++-12},
{CC: gcc-9, CXX: g++-9},
{CC: gcc-10, CXX: g++-10},
]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: "Install libraries"
run: |
sudo apt-get -qq update
sudo apt-get -qq install libboost-all-dev libhdf5-dev libsz2 ninja-build
- name: Build
env: ${{matrix.env}}
run: |
CMAKE_OPTIONS=(-DHIGHFIVE_TEST_BOOST=ON -GNinja)
source $GITHUB_WORKSPACE/.github/build.sh
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -j2 --output-on-failure -C $BUILD_TYPE
- name: Test No HDF5 Diagnositics
working-directory: ${{github.workspace}}/build
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
run: $GITHUB_WORKSPACE/.github/run_examples.sh
# Job running unit-test with sanitizers
# =====================================
Linux_Sanitizers:
runs-on: ubuntu-20.04
strategy:
matrix:
env: [
{CC: clang-12, CXX: clang++-12, HIGHFIVE_SANITIZER: address},
{CC: clang-12, CXX: clang++-12, HIGHFIVE_SANITIZER: undefined},
{CC: gcc-10, CXX: g++-10, HIGHFIVE_GLIBCXX_ASSERTIONS: On},
]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: "Install libraries"
run: |
sudo apt-get -qq update
sudo apt-get -qq install libboost-all-dev libeigen3-dev libhdf5-dev libsz2 ninja-build
- name: Build
env: ${{matrix.env}}
run: |
CMAKE_OPTIONS=(
-GNinja
-DHIGHFIVE_TEST_BOOST:BOOL=ON
-DHIGHFIVE_TEST_EIGEN:BOOL=ON
-DHIGHFIVE_BUILD_DOCS:BOOL=FALSE
-DHIGHFIVE_GLIBCXX_ASSERTIONS=${HIGHFIVE_GLIBCXX_ASSERTIONS:-OFF}
-DHIGHFIVE_SANITIZER=${HIGHFIVE_SANITIZER:-OFF}
)
source $GITHUB_WORKSPACE/.github/build.sh
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -j2 --output-on-failure -C $BUILD_TYPE
- name: Test No HDF5 Diagnositics
working-directory: ${{github.workspace}}/build
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
run: $GITHUB_WORKSPACE/.github/run_examples.sh
# Job to check using HighFive from other CMake projects
# =====================================================
CMake_Project:
runs-on: ubuntu-20.04
strategy:
matrix:
parallelism: [ serial, parallel ]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: "Update Ubuntu"
run: |
sudo apt-get -qq update
- name: "Install common libraries"
run: |
sudo apt-get -qq install libboost-all-dev libsz2 ninja-build
- name: "Install serial HDF5"
if: matrix.parallelism == 'serial'
run: |
sudo apt-get -qq install libhdf5-dev
- name: "Install parallel HDF5"
if: matrix.parallelism == 'parallel'
run: |
sudo apt-get -qq install libhdf5-openmpi-dev
- name: "CMake Project Integration"
run: bash tests/cmake_integration/test_cmake_integration.sh
# Job checking the benchmarks work
# ================================
Benchmarks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: "Install libraries"
run: |
sudo apt -y update
sudo apt -y install --no-install-recommends libhdf5-dev pkg-config
- name: "Build benchmarks"
working-directory: ${{github.workspace}}/src/benchmarks
run: make
- run: time ${{github.workspace}}/src/benchmarks/highfive_bench
# Job testing in OSX
# ==================
OSX:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ "macOS-12" ]
cxxstd: ["14", "17", "20"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: "Install libraries (OSX)"
run: brew install boost eigen hdf5 ninja xtensor
- name: Build
run: |
CMAKE_OPTIONS=(
-GNinja
-DHIGHFIVE_TEST_BOOST:BOOL=ON
-DHIGHFIVE_TEST_EIGEN:BOOL=ON
-DHIGHFIVE_TEST_XTENSOR:BOOL=ON
-DHIGHFIVE_BUILD_DOCS:BOOL=FALSE
-DHIGHFIVE_TEST_SINGLE_INCLUDES=ON
-DCMAKE_CXX_FLAGS="-coverage -O0"
-DCMAKE_CXX_STANDARD=${{matrix.cxxstd}}
)
source $GITHUB_WORKSPACE/.github/build.sh
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -j2 --output-on-failure -C $BUILD_TYPE
- name: Test No HDF5 Diagnositics
working-directory: ${{github.workspace}}/build
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG
- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
run: $GITHUB_WORKSPACE/.github/run_examples.sh
# Job testing in Windows
# ======================
Windows:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ "windows-2022"]
vs-toolset: [ "v141", "v143" ]
cxxstd: ["14", "17", "20"]
include:
- os: "windows-2019"
vs-toolset: "v142"
cxxstd: "14"
- os: "windows-2019"
vs-toolset: "v142"
cxxstd: "17"
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: doc/environment.yaml
environment-name: win-test
- name: Build
shell: bash -l {0}
run: |
CMAKE_OPTIONS=(
-T ${{matrix.vs-toolset}}
-DCMAKE_CXX_STANDARD=${{matrix.cxxstd}}
-DHIGHFIVE_UNIT_TESTS=ON
-DHIGHFIVE_TEST_BOOST:BOOL=ON
-DHIGHFIVE_TEST_EIGEN:BOOL=ON
-DHIGHFIVE_TEST_XTENSOR:BOOL=ON
-DHIGHFIVE_TEST_SINGLE_INCLUDES=ON
)
source $GITHUB_WORKSPACE/.github/build.sh
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash -l {0}
run: |
ctest -j2 --output-on-failure -C $BUILD_TYPE
- name: Test No HDF5 Diagnositics
working-directory: ${{github.workspace}}/build
shell: bash -l {0}
run: |
! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG