Skip to content

Commit 38da26d

Browse files
committed
Add workflow for qsort_r fallback
1 parent 817dbb8 commit 38da26d

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Test qsort_r Fallback
2+
3+
# Triggers the workflow on push or pull request or on demand
4+
on:
5+
workflow_dispatch:
6+
push:
7+
pull_request:
8+
branches: [ develop ]
9+
paths-ignore:
10+
- '.github/CODEOWNERS'
11+
- '.github/FUNDING.yml'
12+
- 'doc/**'
13+
- 'release_docs/**'
14+
- 'ACKNOWLEDGEMENTS'
15+
- 'LICENSE**'
16+
- '**.md'
17+
18+
# Using concurrency to cancel any in-progress job or run
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
test-qsort-fallback:
28+
runs-on: ${{ matrix.os }}
29+
name: Test qsort_r fallback on ${{ matrix.os }}
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: [ubuntu-latest, macos-latest, windows-latest]
35+
36+
# Don't run the action if the commit message says to skip CI
37+
if: "!contains(github.event.head_commit.message, 'skip-ci')"
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v5
42+
43+
- name: Set up build dependencies (Ubuntu)
44+
if: runner.os == 'Linux'
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y cmake gcc g++ zlib1g-dev
48+
49+
- name: Set up build dependencies (macOS)
50+
if: runner.os == 'macOS'
51+
run: |
52+
brew install cmake
53+
54+
- name: Set up build dependencies (Windows)
55+
if: runner.os == 'Windows'
56+
uses: microsoft/setup-msbuild@v2
57+
58+
- name: Configure and build HDF5
59+
run: |
60+
mkdir build
61+
cd build
62+
cmake -C ../config/cmake/cacheinit.cmake \
63+
-DCMAKE_BUILD_TYPE=Release \
64+
-DBUILD_SHARED_LIBS:BOOL=ON \
65+
-DHDF5_ENABLE_PARALLEL:BOOL=OFF \
66+
-DHDF5_BUILD_CPP_LIB:BOOL=OFF \
67+
-DHDF5_BUILD_FORTRAN:BOOL=OFF \
68+
-DHDF5_BUILD_JAVA:BOOL=OFF \
69+
-DHDF5_BUILD_DOC:BOOL=OFF \
70+
-DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \
71+
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \
72+
-DHDF5_TEST_API:BOOL=ON \
73+
-DHDF5_TEST_SHELL_SCRIPTS:BOOL=OFF \
74+
..
75+
cmake --build . --config Release --parallel 4
76+
shell: bash
77+
78+
- name: Force fallback by disabling H5_HAVE_QSORT_REENTRANT
79+
run: |
80+
sed -i.bak 's/#define H5_HAVE_QSORT_REENTRANT 1/#define H5_HAVE_QSORT_REENTRANT 0/' build/src/H5pubconf.h
81+
shell: bash
82+
83+
- name: Run tests with fallback implementation
84+
run: |
85+
cd build
86+
ctest --output-on-failure --parallel 4 -C Release
87+
shell: bash

0 commit comments

Comments
 (0)