Files
hdf5/.github/workflows/openbsd.yml
T
Matt L 10c2ddc3cb Implement fallback for systems without qsort_r (#5931)
Also includes a new workflow to test FreeBSD, which has a different qsort signature and was previously untested
Resolves #5896
2025-11-02 22:06:34 -06:00

95 lines
2.8 KiB
YAML

name: OpenBSD CI
# Triggers the workflow on push or pull request or on demand
on:
workflow_dispatch:
push:
pull_request:
branches: [ develop ]
paths-ignore:
- '.github/CODEOWNERS'
- '.github/FUNDING.yml'
- 'doc/**'
- 'release_docs/**'
- 'ACKNOWLEDGEMENTS'
- 'LICENSE**'
- '**.md'
# Using concurrency to cancel any in-progress job or run
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
openbsd-build-and-test:
runs-on: ubuntu-latest
name: OpenBSD ${{ matrix.openbsd-version }} Build and Test
# Don't run the action if the commit message says to skip CI
if: "!contains(github.event.head_commit.message, 'skip-ci')"
strategy:
fail-fast: false
matrix:
openbsd-version: ['7.5']
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Build and test on OpenBSD
uses: vmactions/openbsd-vm@v1
with:
release: ${{ matrix.openbsd-version }}
usesh: true
prepare: |
echo "https://ftp.openbsd.org/pub/OpenBSD" > /etc/installurl
pkg_add cmake gmake pkgconf curl gcc-11.2.0p11
run: |
set -e
# Set up library path for gcc
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# Get number of processors (OpenBSD uses sysctl in /sbin)
NPROC=$(/sbin/sysctl -n hw.ncpu)
echo "Number of processors: $NPROC"
# Configure the build
mkdir build
cd build
cmake -C ../config/cmake/cacheinit.cmake \
--log-level=VERBOSE \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=egcc \
-DCMAKE_CXX_COMPILER=eg++ \
-DCMAKE_MAKE_PROGRAM=gmake \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DHDF5_ENABLE_ALL_WARNINGS:BOOL=ON \
-DHDF5_ENABLE_PARALLEL:BOOL=OFF \
-DHDF5_BUILD_CPP_LIB:BOOL=OFF \
-DHDF5_BUILD_FORTRAN:BOOL=OFF \
-DHDF5_BUILD_JAVA:BOOL=OFF \
-DHDF5_BUILD_DOC:BOOL=OFF \
-DHDF5_BUILD_HL_LIB:BOOL=OFF \
-DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON \
-DLIBAEC_USE_LOCALCONTENT:BOOL=OFF \
-DZLIB_USE_LOCALCONTENT:BOOL=OFF \
-DHDF5_TEST_API:BOOL=ON \
-DHDF5_TEST_SHELL_SCRIPTS:BOOL=OFF \
-DENABLE_EXTENDED_TESTS:BOOL=OFF \
..
echo ""
# Build
cmake --build . --parallel $NPROC
echo ""
# Run tests
ctest . --parallel $NPROC
echo ""