Skip to content

fix compiler and ci warnings #57

fix compiler and ci warnings

fix compiler and ci warnings #57

Workflow file for this run

name: Ubuntu 24.04
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- dev
jobs:
ci:
name: ${{ matrix.compiler }}-${{ matrix.manager }}
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
env:
cache-name: cache-${{ matrix.compiler }}-${{ matrix.manager }}
strategy:
fail-fast: false # Keep matrix jobs running so failures are easier to inspect
matrix:
include:
- { compiler: gcc, manager: cmake }
- { compiler: gcc, manager: conan }
- { compiler: gcc, manager: find }
- { compiler: clang, manager: cmake }
- { compiler: clang, manager: conan }
- { compiler: clang, manager: find }
steps:
- uses: actions/checkout@v6.0.1
- uses: lukka/get-cmake@v4.2.0
- name: Setup Python
uses: actions/setup-python@v6.1.0
if: matrix.manager == 'conan'
with:
python-version: '3.x'
- name: Update apt
run: |
sudo apt-get update
- name: Prepare cache directories
run: |
mkdir -p ~/.ccache ~/.conan2 install/github-actions-${{ matrix.manager }}
- name: Setup caches
id: h5pp-cache
uses: actions/cache@v4.2.0
with:
path: |
~/.ccache
~/.conan2
install/github-actions-${{ matrix.manager }}
key: ${{ github.workflow }}-${{ env.cache-name }}
- name: Setup gcc
if: matrix.compiler == 'gcc'
run: |
sudo apt-get install gcc-14 g++-14 -y
echo "FC=gfortran-14" >> $GITHUB_ENV
echo "CC=gcc-14" >> $GITHUB_ENV
echo "CXX=g++-14" >> $GITHUB_ENV
- name: Setup clang
if: matrix.compiler == 'clang'
run: |
sudo apt-get install clang-18 libomp-18-dev -y
echo "FC=gfortran-14" >> $GITHUB_ENV
echo "CC=clang-18" >> $GITHUB_ENV
echo "CXX=clang++-18" >> $GITHUB_ENV
- name: Setup build tools
run: |
sudo apt-get install ccache ninja-build gcovr lcov -y
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Setup apt packages (dependencies)
if: matrix.manager == 'find'
run: sudo apt-get install libhdf5-dev libaec-dev libfmt-dev libspdlog-dev libeigen3-dev catch2 -y
- name: Setup conan
if: matrix.manager == 'conan'
run: |
pip install conan
conan profile detect --force
- name: Run CMakePreset
uses: lukka/run-cmake@v10
with:
configurePreset: 'github-actions-${{ matrix.manager }}'
configurePresetAdditionalArgs: "['-DH5PP_ENABLE_COVERAGE=TRUE']"
buildPreset: 'github-actions-${{ matrix.manager }}'
testPreset: 'github-actions-${{ matrix.manager }}'
- name: Install h5pp
if: matrix.compiler == 'gcc' && matrix.manager == 'cmake'
run: cmake --install build/github-actions-cmake
- name: Configure installed-package tester
if: matrix.compiler == 'gcc' && matrix.manager == 'cmake'
run: >
cmake
-S tests/install/find-package
-B "${RUNNER_TEMP}/h5pp-install-find-package"
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/install/github-actions-cmake"
- name: Build installed-package tester
if: matrix.compiler == 'gcc' && matrix.manager == 'cmake'
run: cmake --build "${RUNNER_TEMP}/h5pp-install-find-package"
- name: Run installed-package tester
if: matrix.compiler == 'gcc' && matrix.manager == 'cmake'
run: ctest --test-dir "${RUNNER_TEMP}/h5pp-install-find-package" --output-on-failure
- name: Generate coverage report
if: matrix.compiler == 'gcc' && matrix.manager == 'find'
run: |
lcov --gcov-tool=gcov-14 --capture --rc geninfo_unexecuted_blocks=1 --no-external --directory build/github-actions-find --output-file coverage.info
lcov --gcov-tool=gcov-14 --ignore-errors unused --remove coverage.info '*/test-*' '*catch.hpp' --output-file coverage.info
lcov --gcov-tool=gcov-14 --list coverage.info
- name: Upload coverage to Codecov
if: matrix.compiler == 'gcc' && matrix.manager == 'find'
uses: codecov/codecov-action@v5.5.1
with:
use_oidc: true
files: coverage.info
disable_search: true
fail_ci_if_error: true
verbose: true