forked from HDFGroup/vol-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
232 lines (200 loc) · 7.08 KB
/
main.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
name: HDF5 API test CI
on:
workflow_dispatch:
push:
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
# Using concurrency to cancel any in-progress job or run
concurrency:
group: ${{ github.workflow }}-${{ github.sha || github.event.pull_request.number }}
cancel-in-progress: true
jobs:
build_and_test:
strategy:
matrix:
name:
- "Windows MSVC"
- "Ubuntu GCC"
- "Ubuntu GCC parallel (build only)"
- "MacOS Clang"
build_mode:
- text: " REL"
cmake: "Release"
- text: " DBG"
cmake: "Debug"
include:
# Exclude Windows for now since CMake code throws a
# fatal error about being unsupported on Windows.
# Unclear if the tests can be supported yet, but they
# should run fine on Windows. However, building of the
# test driver code needs to be updated to be optional
# Windows w/ MSVC + CMake
#- name: "Windows MSVC"
# os: windows-2022
# toolchain: ""
# parallel: OFF
# generator: "-G \"Visual Studio 17 2022\" -A x64"
# run_tests: true
# Linux (Ubuntu) w/ GCC + CMake
- name: "Ubuntu GCC"
os: ubuntu-latest
parallel: OFF
toolchain: "config/toolchain/gcc.cmake"
generator: "-G Ninja"
run_tests: true
# Linux (Ubuntu) w/ GCC + CMake (parallel)
- name: "Ubuntu GCC parallel (build only)"
os: ubuntu-latest
parallel: ON
toolchain: "config/toolchain/gcc.cmake"
generator: "-G Ninja"
run_tests: false
# MacOS w/ Clang + CMake
- name: "MacOS Clang"
os: macos-11
parallel: OFF
toolchain: "config/toolchain/clang.cmake"
generator: "-G Ninja"
run_tests: true
#
# SPECIAL BUILDS
#
# -Werror Debug build
- name: "Ubuntu GCC -Werror Debug (build only)"
os: ubuntu-latest
parallel: OFF
toolchain: ""
generator: "-G Ninja"
flags: "-Wall -Wextra -Werror"
run_tests: false
build_mode:
text: " DBG"
cmake: "Debug"
# -Werror Release build
- name: "Ubuntu GCC -Werror Release (build only)"
os: ubuntu-latest
parallel: OFF
toolchain: ""
generator: "-G Ninja"
flags: "-Wall -Wextra -Werror"
run_tests: false
build_mode:
text: " REL"
cmake: "Release"
# -Werror Debug parallel build
- name: "Ubuntu GCC -Werror Debug parallel (build only)"
os: ubuntu-latest
parallel: ON
toolchain: ""
generator: "-G Ninja"
flags: "-Wall -Wextra -Werror"
run_tests: false
build_mode:
text: " DBG"
cmake: "Debug"
# -Werror Release parallel build
- name: "Ubuntu GCC -Werror Release parallel (build only)"
os: ubuntu-latest
parallel: ON
toolchain: ""
generator: "-G Ninja"
flags: "-Wall -Wextra -Werror"
run_tests: false
build_mode:
text: " REL"
cmake: "Release"
exclude:
# Exclude Windows for now since CMake code throws a
# fatal error about being unsupported on Windows.
# Unclear if the tests can be supported yet, but they
# should run fine on Windows. However, building of the
# test driver code needs to be updated to be optional
- name: "Windows MSVC"
# Only test a few debug builds
- name: "Windows MSVC"
build_mode:
text: " DBG"
cmake: "Debug"
- name: "MacOS Clang"
build_mode:
text: " DBG"
cmake: "Debug"
# Sets the job's name from the properties
name: "${{ matrix.name }}${{ matrix.build_mode.text }}"
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
steps:
- name: Dump matrix context
run: echo '${{ toJSON(matrix) }}'
- name: Checkout API tests
uses: actions/checkout@v3
with:
path: api-tests
- name: Checkout HDF5
uses: actions/checkout@v3
with:
repository: HDFGroup/hdf5
path: hdf5
- name: Install Dependencies (Linux)
run: sudo apt-get install ninja-build
if: matrix.os == 'ubuntu-latest'
- name: Install Dependencies (Linux, parallel)
run: |
sudo apt update
sudo apt install ninja-build
sudo apt install openmpi-bin openmpi-common mpi-default-dev
echo "CC=mpicc" >> $GITHUB_ENV
sudo apt install libaec0 libaec-dev
if: (matrix.parallel == 'ON')
- name: Install Dependencies (Windows)
run: choco install ninja
if: matrix.os == 'windows-latest'
- name: Install Dependencies (macOS)
run: brew install ninja
if: matrix.os == 'macos-11'
- name: Set environment for MSVC (Windows)
run: |
# Set these environment variables so CMake picks the correct compiler
echo "CXX=cl.exe" >> $GITHUB_ENV
echo "CC=cl.exe" >> $GITHUB_ENV
if: matrix.os == 'windows-latest'
- name: Install HDF5
run: |
cd "$GITHUB_WORKSPACE/hdf5"
mkdir "build"
cd "build"
cmake ${{ matrix.generator }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_mode.cmake }} \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/hdf5_build \
-DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_ENABLE_ALL_WARNINGS=ON \
-DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} \
..
cmake --build . --parallel 3 --config ${{ matrix.build_mode.cmake }}
cmake --install . --config ${{ matrix.build_mode.cmake }}
shell: bash
- name: Install API tests
run: |
cd "$GITHUB_WORKSPACE/api-tests"
mkdir "build"
cd "build"
cmake ${{ matrix.generator }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_mode.cmake }} \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/api_tests_build \
-DCMAKE_C_FLAGS="${{ matrix.flags }}" \
-DHDF5_DIR=$GITHUB_WORKSPACE/hdf5_build \
-DHDF5_VOL_TEST_ENABLE_PART=ON \
-DHDF5_VOL_TEST_ENABLE_PARALLEL=${{ matrix.parallel }} \
-DHDF5_VOL_TEST_ENABLE_ASYNC=ON \
..
cmake --build . --parallel 3 --config ${{ matrix.build_mode.cmake }}
shell: bash
- name: Run API tests
run: |
cd "$GITHUB_WORKSPACE/api-tests/build"
ctest --build . --parallel 2 -C ${{ matrix.build_mode.cmake }} -V
if: (matrix.run_tests)