Skip to content

AHDF5 Unit Tests

AHDF5 Unit Tests #17

name: AHDF5 Unit Tests
on:
# Run on pushes to main
push:
branches:
- main
# Run on pull requests to main
pull_request:
branches:
- main
# Run daily at 9 AM UTC
schedule:
- cron: '0 9 * * *'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12'] #['3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Restore HDF5 cache
id: cache-hdf5
uses: actions/cache/restore@v4
with:
path: ~/hdf5-install
key: hdf5-2.0.0-zlib-ubuntu-${{ runner.os }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build HDF5 2.0.0 with tools
if: steps.cache-hdf5.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y cmake zlib1g-dev
wget https://github.com/HDFGroup/hdf5/releases/download/2.0.0/hdf5.tar.gz
tar -xzf hdf5.tar.gz
cd hdf5-2.0.0
mkdir build && cd build
cmake -DHDF5_BUILD_TOOLS=ON \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
-DCMAKE_INSTALL_PREFIX=$HOME/hdf5-install \
..
echo "=== CMake Configuration Summary ==="
grep -i "zlib" CMakeCache.txt || echo "No zlib found in CMakeCache.txt"
make -j$(nproc)
make install
echo "=== Verify tools were built ==="
ls -lh $HOME/hdf5-install/bin/
- name: Install HDF5 to system
run: |
sudo cp -r $HOME/hdf5-install/* /usr/local/
sudo ldconfig
echo "=== h5repack version ==="
h5repack --version || echo "h5repack not found"
echo "=== Available HDF5 tools ==="
ls -lh /usr/local/bin/h5* || echo "No h5 tools found"
- name: Run h5py MCP tests
run: |
# Skip filter tests due to inconsistent h5repack filter availability in GitHub Actions.
# h5repack command-line tools are not reliably available with pip-installed h5py,
# and system HDF5 installations may not have consistent filter support (e.g., deflate/gzip).
pytest -k "not TestApplyFilterDataset"
- name: Save HDF5 cache
uses: actions/cache/save@v4
if: always() && steps.cache-hdf5.outputs.cache-hit != 'true'
with:
path: ~/hdf5-install
key: hdf5-2.0.0-zlib-ubuntu-${{ runner.os }}