Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 248 additions & 0 deletions .github/workflows/main-fetchcontent-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
name: HDF5 plugins testing with CMake FetchContent on MacOS

on:
workflow_call:
inputs:
build_mode:
description: "Build type (CMAKE_BUILD_TYPE)"
required: true
type: string
hdf5_tag:
description: "HDF5 git tag to use"
required: false
default: "develop"
type: string
zlib_type:
description: "Type of zlib to use ('zlib' (default) or 'zlib-ng')"
required: false
default: "zlib"
type: string

permissions:
contents: read

jobs:
# Test building filter libraries and hdf5_plugins project inline with CMake's
# FetchContent (git) functionality while building HDF5.
build_and_test_inline:
name: "MacOS Clang (hdf5_plugins built inline with HDF5)"
runs-on: macos-latest
steps:
- name: Get sources for HDF5
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
repository: HDFGroup/hdf5
ref: "${{ inputs.hdf5_tag }}"
path: ${{ github.workspace }}/hdf5

- name: Set zlib-ng option
id: set_zlibng_option
run: |
if test "${{ inputs.zlib_type }}" = "zlib-ng"; then
echo "zlibng_option=ON" >> "$GITHUB_OUTPUT"
echo "zlib_external=ON" >> "$GITHUB_OUTPUT"
else
echo "zlibng_option=OFF" >> "$GITHUB_OUTPUT"
echo "zlib_external=OFF" >> "$GITHUB_OUTPUT"
fi

# TODO: Re-enable ZSTD testing after CMake logic issue is fixed
Copy link
Copy Markdown
Contributor Author

@jhendersonHDF jhendersonHDF Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZSTD currently has a CMake logic issue preventing building with FetchContent

# NOTE: HDF_ENABLE_BLOSC_ZLIB_SUPPORT is set to OFF because otherwise
# the hdf5_plugins Blosc build process will try to build its own zlib
# instead of allowing blosc to use its internal sources that are patched
# for MacOS.
- name: Build HDF5 and HDF5 plugins
run: |
cd ${{ github.workspace }}/hdf5
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/hdf5_build \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_ALLOW_EXTERNAL_SUPPORT=GIT \
-DHDF5_ENABLE_ZLIB_SUPPORT=OFF \
-DZLIB_USE_EXTERNAL=${{ steps.set_zlibng_option.outputs.zlib_external }} \
-DHDF5_USE_ZLIB_NG=${{ steps.set_zlibng_option.outputs.zlibng_option }} \
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
-DSZIP_USE_EXTERNAL=ON \
-DHDF5_ENABLE_PLUGIN_SUPPORT=ON \
-DPLUGIN_USE_EXTERNAL=ON \
-DPLUGIN_USE_LOCALCONTENT=OFF \
-DH5PL_ALLOW_EXTERNAL_SUPPORT=GIT \
-DH5PL_BUILD_TESTING=ON \
-DH5PL_BUILD_EXAMPLES=ON \
-DENABLE_BLOSC=ON \
-DHDF_ENABLE_BLOSC_ZLIB_SUPPORT=OFF \
-DENABLE_BLOSC2=ON \
-DENABLE_BZIP2=ON \
-DENABLE_JPEG=ON \
-DENABLE_LZ4=ON \
-DENABLE_LZF=ON \
-DENABLE_ZFP=ON \
-DENABLE_ZSTD=OFF \
-DENABLE_BITGROOM=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
..
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
cmake --install . --config ${{ inputs.build_mode }}

- name: Test HDF5 and HDF5 plugins
shell: bash
run: |
cd "${{ github.workspace }}/hdf5/build"
ctest . --output-on-failure --parallel 3 -C ${{ inputs.build_mode }}

# Test building hdf5_plugins project against an already-installed HDF5. Filter
# libraries are built with FetchContent (git) while building hdf5_plugins.
build_and_test_git:
name: "MacOS Clang (hdf5_plugins built standalone; plugins built via git)"
runs-on: macos-latest
steps:
- name: Get sources for HDF5 plugins project
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Get sources for HDF5
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
repository: HDFGroup/hdf5
ref: "${{ inputs.hdf5_tag }}"
path: ${{ github.workspace }}/hdf5

- name: Set zlib-ng option
id: set_zlibng_option
run: |
if test "${{ inputs.zlib_type }}" = "zlib-ng"; then
echo "zlibng_option=ON" >> "$GITHUB_OUTPUT"
else
echo "zlibng_option=OFF" >> "$GITHUB_OUTPUT"
fi

- name: Build HDF5
run: |
cd ${{ github.workspace }}/hdf5
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/hdf5_build \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_ALLOW_EXTERNAL_SUPPORT=GIT \
-DHDF5_ENABLE_ZLIB_SUPPORT=ON \
-DZLIB_USE_EXTERNAL=ON \
-DHDF5_USE_ZLIB_NG=${{ steps.set_zlibng_option.outputs.zlibng_option }} \
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
-DSZIP_USE_EXTERNAL=ON \
..
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
cmake --install . --config ${{ inputs.build_mode }}

# NOTE: HDF_ENABLE_BLOSC_ZLIB_SUPPORT is set to OFF because otherwise
# the hdf5_plugins Blosc build process will try to build its own zlib
# instead of allowing blosc to use its internal sources that are patched
# for MacOS.
- name: Build HDF5 plugins project
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DHDF5_DIR=${{ github.workspace }}/hdf5_build/cmake \
-DH5PL_ALLOW_EXTERNAL_SUPPORT=GIT \
-DH5PL_BUILD_TESTING=ON \
-DH5PL_BUILD_EXAMPLES=ON \
-DENABLE_BLOSC=ON \
-DHDF_ENABLE_BLOSC_ZLIB_SUPPORT=OFF \
-DENABLE_BLOSC2=ON \
-DENABLE_BZIP2=ON \
-DENABLE_JPEG=ON \
-DENABLE_LZ4=ON \
-DENABLE_LZF=ON \
-DENABLE_ZFP=ON \
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}

- name: Test HDF5 plugins project
run: |
cd "${{ runner.workspace }}/build"
ctest . --output-on-failure --parallel 4 -C ${{ inputs.build_mode }}

# Test building hdf5_plugins project against an already-installed HDF5. Filter
# libraries are built with FetchContent (tgz) while building hdf5_plugins.
build_and_test_tgz:
name: "MacOS Clang (hdf5_plugins built standalone; plugins built via tgz)"
runs-on: macos-latest
steps:
- name: Get sources for HDF5 plugins project
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Get sources for HDF5
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
repository: HDFGroup/hdf5
ref: "${{ inputs.hdf5_tag }}"
path: ${{ github.workspace }}/hdf5

- name: Set zlib-ng option
id: set_zlibng_option
run: |
if test "${{ inputs.zlib_type }}" = "zlib-ng"; then
echo "zlibng_option=ON" >> "$GITHUB_OUTPUT"
else
echo "zlibng_option=OFF" >> "$GITHUB_OUTPUT"
fi

- name: Build HDF5
run: |
cd ${{ github.workspace }}/hdf5
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/hdf5_build \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_ALLOW_EXTERNAL_SUPPORT=TGZ \
-DHDF5_ENABLE_ZLIB_SUPPORT=ON \
-DZLIB_USE_EXTERNAL=ON \
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_USE_ZLIB_NG=${{ steps.set_zlibng_option.outputs.zlibng_option }} \
-DHDF5_ENABLE_SZIP_SUPPORT=ON \
-DSZIP_USE_EXTERNAL=ON \
-DLIBAEC_USE_LOCALCONTENT=OFF \
..
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
cmake --install . --config ${{ inputs.build_mode }}

- name: Build HDF5 plugins project
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DHDF5_DIR=${{ github.workspace }}/hdf5_build/cmake \
-DH5PL_ALLOW_EXTERNAL_SUPPORT=TGZ \
-DH5PL_BUILD_TESTING=ON \
-DH5PL_BUILD_EXAMPLES=ON \
-DENABLE_BLOSC=ON \
-DENABLE_BLOSC2=ON \
-DENABLE_BZIP2=ON \
-DENABLE_JPEG=ON \
-DENABLE_LZ4=ON \
-DENABLE_LZF=ON \
-DENABLE_ZFP=ON \
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}

- name: Test HDF5 plugins project
run: |
cd "${{ runner.workspace }}/build"
ctest . --output-on-failure --parallel 3 -C ${{ inputs.build_mode }}
Loading
Loading