Skip to content

Commit 19d1166

Browse files
authored
Adds macOS-26 matrix testing workflow to CI for diverse build configurations.
1 parent 6ea1f50 commit 19d1166

File tree

1 file changed

+285
-0
lines changed

1 file changed

+285
-0
lines changed
Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
name: macOS-26 Matrix Testing
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
10+
11+
jobs:
12+
build-test:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
# Test combinations of key options
17+
include:
18+
# Shared libraries with OpenMPI
19+
- name: "macOS-26 Shared OpenMPI Fortran Java"
20+
os: macos-26
21+
mpi: openmpi
22+
shared_libs: ON
23+
static_libs: OFF
24+
cpp: OFF
25+
fortran: OFF
26+
java: ON
27+
hl: ON
28+
threadsafe: OFF
29+
parallel: ON
30+
tools: ON
31+
tests: ON
32+
examples: ON
33+
zlib: ON
34+
szip: ON
35+
36+
# Shared libraries with MPICH
37+
- name: "macOS-26 Shared MPICH Fortran"
38+
os: macos-26
39+
mpi: mpich
40+
shared_libs: ON
41+
static_libs: OFF
42+
cpp: OFF
43+
fortran: ON
44+
java: OFF
45+
hl: ON
46+
threadsafe: OFF
47+
parallel: ON
48+
tools: ON
49+
tests: ON
50+
examples: ON
51+
zlib: ON
52+
szip: ON
53+
54+
# Static libraries with OpenMPI
55+
- name: "macOS-26 Static OpenMPI"
56+
os: macos-26
57+
mpi: openmpi
58+
shared_libs: OFF
59+
static_libs: ON
60+
cpp: OFF
61+
fortran: OFF
62+
java: OFF
63+
hl: ON
64+
threadsafe: OFF
65+
parallel: ON
66+
tools: ON
67+
tests: ON
68+
examples: ON
69+
zlib: ON
70+
szip: OFF
71+
72+
# Both static and shared with MPICH
73+
- name: "macOS-26 Both MPICH All Features"
74+
os: macos-26
75+
mpi: mpich
76+
shared_libs: ON
77+
static_libs: ON
78+
cpp: ON
79+
fortran: ON
80+
java: OFF
81+
hl: ON
82+
threadsafe: OFF
83+
parallel: ON
84+
tools: ON
85+
tests: ON
86+
examples: ON
87+
zlib: ON
88+
szip: ON
89+
90+
# Serial build with thread-safety
91+
- name: "macOS-26 Serial Threadsafe"
92+
os: macos-26
93+
mpi: none
94+
shared_libs: ON
95+
static_libs: ON
96+
cpp: ON
97+
fortran: OFF
98+
java: OFF
99+
hl: OFF
100+
threadsafe: ON
101+
parallel: OFF
102+
tools: ON
103+
tests: ON
104+
examples: ON
105+
zlib: ON
106+
szip: ON
107+
108+
# Minimal configuration
109+
- name: "macOS-26 Minimal Config"
110+
os: macos-26
111+
mpi: none
112+
shared_libs: ON
113+
static_libs: OFF
114+
cpp: OFF
115+
fortran: OFF
116+
java: OFF
117+
hl: OFF
118+
threadsafe: OFF
119+
parallel: OFF
120+
tools: OFF
121+
tests: ON
122+
examples: OFF
123+
zlib: OFF
124+
szip: OFF
125+
126+
# Plugin support with OpenMPI
127+
- name: "macOS-26 Plugins OpenMPI"
128+
os: macos-26
129+
mpi: openmpi
130+
shared_libs: ON
131+
static_libs: OFF
132+
cpp: OFF
133+
fortran: OFF
134+
java: OFF
135+
hl: ON
136+
threadsafe: OFF
137+
parallel: ON
138+
tools: ON
139+
tests: ON
140+
examples: ON
141+
zlib: ON
142+
szip: ON
143+
plugins: ON
144+
145+
# No High Level API with MPICH
146+
- name: "macOS-26 No HL MPICH"
147+
os: macos-26
148+
mpi: mpich
149+
shared_libs: ON
150+
static_libs: ON
151+
cpp: ON
152+
fortran: OFF
153+
java: OFF
154+
hl: OFF
155+
threadsafe: OFF
156+
parallel: ON
157+
tools: ON
158+
tests: ON
159+
examples: ON
160+
zlib: ON
161+
szip: ON
162+
163+
name: ${{ matrix.name }}
164+
runs-on: ${{ matrix.os }}
165+
if: "!contains(github.event.head_commit.message, 'skip-ci')"
166+
167+
steps:
168+
- name: Install Dependencies
169+
run: |
170+
# Install base dependencies
171+
brew install autoconf automake libtool
172+
173+
# Install compression libraries
174+
brew install zlib
175+
if [[ "${{ matrix.szip }}" == "ON" ]]; then
176+
brew install libaec
177+
fi
178+
179+
# Install MPI libraries
180+
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
181+
brew install openmpi
182+
elif [[ "${{ matrix.mpi }}" == "mpich" ]]; then
183+
brew install mpich
184+
fi
185+
186+
187+
- name: Get Sources
188+
uses: actions/checkout@v5
189+
190+
- name: Configure
191+
run: |
192+
mkdir "${{ runner.workspace }}/build"
193+
cd "${{ runner.workspace }}/build"
194+
195+
# Base CMake options
196+
CMAKE_OPTS="-G Ninja"
197+
CMAKE_OPTS="$CMAKE_OPTS -DCMAKE_BUILD_TYPE=Release"
198+
CMAKE_OPTS="$CMAKE_OPTS -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }}"
199+
CMAKE_OPTS="$CMAKE_OPTS -DBUILD_STATIC_LIBS=${{ matrix.static_libs }}"
200+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_BUILD_CPP_LIB=${{ matrix.cpp }}"
201+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }}"
202+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_BUILD_JAVA=${{ matrix.java }}"
203+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_BUILD_HL_LIB=${{ matrix.hl }}"
204+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_ENABLE_THREADSAFE=${{ matrix.threadsafe }}"
205+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_ENABLE_PARALLEL=${{ matrix.parallel }}"
206+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_BUILD_TOOLS=${{ matrix.tools }}"
207+
CMAKE_OPTS="$CMAKE_OPTS -DBUILD_TESTING=${{ matrix.tests }}"
208+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_BUILD_EXAMPLES=${{ matrix.examples }}"
209+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_ENABLE_ZLIB_SUPPORT=${{ matrix.zlib }}"
210+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_ENABLE_SZIP_SUPPORT=${{ matrix.szip }}"
211+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_ALLOW_UNSUPPORTED=ON"
212+
213+
# Plugin support if specified
214+
if [[ "${{ matrix.plugins }}" == "ON" ]]; then
215+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_ENABLE_PLUGIN_SUPPORT=ON"
216+
CMAKE_OPTS="$CMAKE_OPTS -DHDF5_ALLOW_EXTERNAL_SUPPORT=TGZ"
217+
CMAKE_OPTS="$CMAKE_OPTS -DPLUGIN_USE_LOCALCONTENT=OFF"
218+
fi
219+
220+
# Set Java environment if needed
221+
if [[ "${{ matrix.java }}" == "ON" ]]; then
222+
export JAVA_HOME=$(/usr/libexec/java_home)
223+
CMAKE_OPTS="$CMAKE_OPTS -DJAVA_HOME=$JAVA_HOME"
224+
fi
225+
226+
# Set Fortran compiler if needed
227+
if [[ "${{ matrix.fortran }}" == "ON" ]]; then
228+
CMAKE_OPTS="$CMAKE_OPTS -DCMAKE_Fortran_COMPILER=gfortran-15"
229+
fi
230+
231+
# MPI configuration
232+
if [[ "${{ matrix.parallel }}" == "ON" ]]; then
233+
CMAKE_OPTS="$CMAKE_OPTS -DMPIEXEC_MAX_NUMPROCS=2"
234+
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
235+
CMAKE_OPTS="$CMAKE_OPTS -DMPI_C_COMPILER=mpicc"
236+
CMAKE_OPTS="$CMAKE_OPTS -DMPIEXEC_PREFLAGS=--oversubscribe"
237+
elif [[ "${{ matrix.mpi }}" == "mpich" ]]; then
238+
CMAKE_OPTS="$CMAKE_OPTS -DMPI_C_COMPILER=mpicc"
239+
CMAKE_OPTS="$CMAKE_OPTS -DCMAKE_Fortran_COMPILER=mpifort"
240+
sudo ln -s /opt/homebrew/bin/gfortran-15 /opt/homebrew/bin/gfortran
241+
mpifort --version
242+
fi
243+
fi
244+
245+
echo "Configuration options: $CMAKE_OPTS"
246+
cmake $CMAKE_OPTS "$GITHUB_WORKSPACE"
247+
shell: bash
248+
249+
- name: Build
250+
run: cmake --build . --config Release --parallel 2
251+
working-directory: ${{ runner.workspace }}/build
252+
253+
- name: Test
254+
run: |
255+
# Run tests with appropriate settings for each configuration
256+
if [[ "${{ matrix.parallel }}" == "ON" ]]; then
257+
# For parallel builds, limit concurrent tests
258+
ctest . -C Release -V --parallel 1
259+
else
260+
# For serial builds, can run more tests concurrently
261+
ctest . -C Release -V --parallel 2
262+
fi
263+
working-directory: ${{ runner.workspace }}/build
264+
env:
265+
# Set test timeout
266+
CTEST_TIMEOUT: 3600
267+
268+
- name: Upload Test Results
269+
uses: actions/upload-artifact@v4
270+
if: always()
271+
with:
272+
name: test-results-${{ matrix.name }}
273+
path: |
274+
${{ runner.workspace }}/build/Testing/Temporary/CTestCostData.txt
275+
${{ runner.workspace }}/build/Testing/Temporary/LastTest.log
276+
retention-days: 7
277+
278+
- name: Show Test Summary
279+
if: always()
280+
run: |
281+
echo "=== Test Summary for ${{ matrix.name }} ==="
282+
if [[ -f Testing/Temporary/LastTest.log ]]; then
283+
tail -50 Testing/Temporary/LastTest.log
284+
fi
285+
working-directory: ${{ runner.workspace }}/build

0 commit comments

Comments
 (0)