Skip to content
Open
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
28 changes: 28 additions & 0 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Query filters to include or exclude specific queries
query-filters:
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-short-global-name/
id: cpp/short-global-name
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-commented-out-code/
id: cpp/commented-out-code
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-poorly-documented-function/
id: cpp/poorly-documented-function
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-trivial-switch/
id: cpp/trivial-switch
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-irregular-enum-init/
id: cpp/irregular-enum-init
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-guarded-free/
id: cpp/guarded-free

# Directories to scan for vulnerabilities
paths:
- src # Main source directory

# Directories and files to ignore during the scan
paths-ignore:
- tests # Test directory
4 changes: 2 additions & 2 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run clang-format style check for C programs.
uses: DoozyX/clang-format-lint-action@v0.18.2
uses: DoozyX/clang-format-lint-action@v0.18
with:
source: '.'
extensions: 'c,h,cpp,hpp'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run clang-format style check for C programs.
uses: DoozyX/clang-format-lint-action@v0.18.2
uses: DoozyX/clang-format-lint-action@v0.18
with:
source: '.'
extensions: 'c,h,cpp,hpp'
Expand Down
178 changes: 178 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Coverage

# Collects line + branch coverage for the C benchmarks and the Python
# driver, then uploads both reports to Codecov. Runs against a single HDF5
# version (1.14.0) with every optional benchmark + VOL-ASYNC enabled, so a
# single job reflects the whole test matrix's coverage surface — at the
# cost of a ~60–90 minute wall clock that we don't want to repeat on every
# per-HDF5-version workflow.

on:
pull_request:
branches:
- develop
- master

push:
branches:
- master

workflow_dispatch:

schedule:
# Weekly drift check — catches regressions from merges that don't
# touch a coverage-triggering path.
- cron: '0 6 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-24.04
container:
image: hpcio/hdf5-1.14.0
timeout-minutes: 90
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v5
with:
submodules: true

- name: Configuration
run: |
git config --global user.email "ci@github.com"
git config --global user.name "Github CI"

- name: Install coverage tooling
run: |
# The hpcio/hdf5-1.14.0 base image is Ubuntu 20.04 with python3
# + pip preinstalled but no python3-venv, and its apt sources
# reference a Kitware repo whose GPG key has rotated and now
# breaks `apt-get update`. Skip apt entirely and install the
# coverage tools (gcovr is a pure-Python package too) into
# /root/.local via `pip --user`. 20.04 predates PEP 668 so no
# externally-managed-environment dance is needed.
python3 --version
pip3 install --quiet --user --upgrade 'pip<24.1'
python3 -m pip install --quiet --user coverage gcovr h5py numpy pytest
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Clone VOL-ASYNC
run: |
git clone --recursive https://github.com/hpc-io/vol-async.git --branch v1.7 /opt/vol-async

- name: Build Argobots
run: |
export ABT_DIR=/opt/argobots
cd /opt/vol-async/argobots
./autogen.sh
./configure --prefix=$ABT_DIR
make -j 2
make install

- name: Build VOL-ASYNC
run: |
export HDF5_DIR=/opt/hdf5
export ABT_DIR=/opt/argobots
export ASYNC_DIR=/opt/vol-async
cd $ASYNC_DIR
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=$ASYNC_DIR \
-DCMAKE_PREFIX_PATH=$HDF5_DIR \
-DENABLE_WRITE_MEMCPY=ON
make
make install

- name: Build h5bench with coverage instrumentation
run: |
export HDF5_HOME=/opt/hdf5
export ABT_HOME=/opt/argobots
export ASYNC_HOME=/opt/vol-async
export LD_LIBRARY_PATH=$ASYNC_HOME/lib:$HDF5_HOME/lib:$ABT_HOME/lib:$LD_LIBRARY_PATH

mkdir build-cov
cd build-cov

# --coverage applies to every compilation unit reached through
# the h5bench CMakeLists; AMReX/OpenPMD/etc. are built via
# add_subdirectory and inherit it too.
cmake .. \
-DH5BENCH_ALL=ON \
-DWITH_ASYNC_VOL:BOOL=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="--coverage -g -O0 -I$ASYNC_HOME/include -L$ASYNC_HOME/lib" \
-DCMAKE_CXX_FLAGS="--coverage -g -O0" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="--coverage"

make -j 2

- name: Run tests under coverage
run: |
export HDF5_HOME=/opt/hdf5
export HDF5_DIR=$HDF5_HOME
export ABT_DIR=/opt/argobots
export ASYNC_DIR=/opt/vol-async
export LD_LIBRARY_PATH=$ASYNC_DIR/lib:$HDF5_DIR/lib:$ABT_DIR/lib:$LD_LIBRARY_PATH

cd build-cov

# Drive pytest directly (the tests/CMakeLists.txt entries each
# wrap one test file). --source=${GITHUB_WORKSPACE}/src keeps
# coverage.py focused on the driver module; the legacy tests in
# .github/workflows/h5bench-hdf5-*.yml cover behaviour, this
# job exists for the *numbers*.
python3 -m coverage run --branch \
--source=${GITHUB_WORKSPACE}/src \
-m pytest --verbose --rootdir . ${GITHUB_WORKSPACE}/tests/
continue-on-error: true

- name: Collect C coverage (gcovr)
run: |
cd build-cov
gcovr \
--root ${GITHUB_WORKSPACE} \
--filter="${GITHUB_WORKSPACE}/commons/" \
--filter="${GITHUB_WORKSPACE}/h5bench_patterns/" \
--filter="${GITHUB_WORKSPACE}/exerciser/" \
--filter="${GITHUB_WORKSPACE}/metadata_stress/" \
--print-summary \
--xml coverage-c.xml \
--html-details coverage-c.html \
.

- name: Collect Python coverage
run: |
cd build-cov
python3 -m coverage xml -o coverage-python.xml
python3 -m coverage report

- name: Upload reports to Codecov
uses: codecov/codecov-action@v4
with:
files: build-cov/coverage-c.xml,build-cov/coverage-python.xml
flags: c,python
fail_ci_if_error: false
# Optional secret. Public-repo tokenless upload still works in
# v4 but adding CODECOV_TOKEN in Settings → Secrets makes
# uploads more reliable under rate limiting.
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
build-cov/coverage-c.xml
build-cov/coverage-c.html
build-cov/coverage-python.xml
retention-days: 14
4 changes: 2 additions & 2 deletions .github/workflows/h5bench-hdf5-1.10.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
with:
submodules: true

Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: test
path: build/storage/**/std*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/h5bench-hdf5-1.10.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
with:
submodules: true

Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: test
path: build/h5bench_e3sm-prefix/src/h5bench_e3sm-stamp/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/h5bench-hdf5-1.10.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
with:
submodules: true

Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: test
path: build/storage/**/std*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/h5bench-hdf5-1.12.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
with:
submodules: true

Expand Down Expand Up @@ -258,7 +258,7 @@ jobs:

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: test
path: build/storage/**/std*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/h5bench-hdf5-1.14.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
with:
submodules: true

Expand Down Expand Up @@ -513,7 +513,7 @@ jobs:

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: test
path: build*/storage/**/std*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/h5bench-hdf5-1.14.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
with:
submodules: true

Expand Down Expand Up @@ -513,7 +513,7 @@ jobs:

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: test
path: build*/storage/**/std*
Expand Down
Loading
Loading