ci: split light and heavy CI. #136
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Unit Tests | ||
| # See, scorecard.dev (Token Permission) | ||
| # https://github.com/ossf/scorecard/blob/a16e0f9eb245274f08512e33dc7afa78d21c460c/docs/checks.md#token-permissions | ||
| permissions: read-all | ||
| concurrency: | ||
| group: ${{ github.workflow }}#${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'main' }} | ||
| on: | ||
| schedule: | ||
| - cron: '0 8 * * 1' # Run every Monday at 8 AM UTC | ||
| workflow_dispatch: | ||
| inputs: | ||
| test_suite: | ||
| description: 'Test suite to run (comma-separated, empty for all)' | ||
| required: false | ||
| default: '' | ||
| type: string | ||
| push: | ||
| branches: | ||
| - master | ||
| - main | ||
| - v2.x | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - main | ||
| - v2.x | ||
| paths-ignore: | ||
| - '**.md' | ||
| - '**.rst' | ||
| - 'doc/**' | ||
| types: [opened, synchronize, reopened, labeled] | ||
| env: | ||
| HOMEBREW_NO_AUTO_UPDATE: 1 # for reproducibility, dont autoupdate | ||
| BUILD_TYPE: RelWithDebInfo | ||
| INSTALL_DIR: install | ||
| # Run everything for schedule and workflow_dispatch | ||
| # For PRs with labels, collect all matching test suites plus "always" | ||
| RUN_SUITE: >- | ||
| ${{ | ||
| (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | ||
| && 'all' | ||
| || format('{0}{1}{2}{3}{4}{5}', | ||
| 'always', | ||
| contains(github.event.pull_request.labels.*.name, 'ci-mpi-all') && ',mpi' || '', | ||
| contains(github.event.pull_request.labels.*.name, 'ci-hdf5-all') && ',hdf5' || '', | ||
| contains(github.event.pull_request.labels.*.name, 'ci-compiler-all') && ',compiler' || '', | ||
| contains(github.event.pull_request.labels.*.name, 'ci-osx-all') && ',osx' || '', | ||
| contains(github.event.pull_request.labels.*.name, 'ci-windows-all') && ',windows' || '' | ||
| ) | ||
| }} | ||
| jobs: | ||
| Linux_MPI: | ||
| runs-on: ${{ matrix.config.os }} | ||
| name: Linux_MPI (${{ toJson(matrix.config) }}) | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| # Always run basic config | ||
| - config: | ||
| os: ubuntu-24.04 | ||
| pkgs: '' | ||
| run_cond: "always" | ||
| # Additional configs for specific test suites | ||
| - config: | ||
| os: ubuntu-24.04 | ||
| pkgs: 'libboost-all-dev libopencv-dev' | ||
| flags: '-DHIGHFIVE_TEST_BOOST:Bool=ON -DHIGHFIVE_TEST_OPENCV:Bool=ON -GNinja' | ||
| run_cond: "mpi" | ||
| - config: | ||
| os: ubuntu-latest | ||
| pkgs: 'libboost-all-dev libeigen3-dev libopencv-dev' | ||
| flags: '-DHIGHFIVE_TEST_BOOST:Bool=ON -DHIGHFIVE_TEST_EIGEN:Bool=ON -DHIGHFIVE_TEST_OPENCV:Bool=ON -GNinja' | ||
| run_cond: "mpi" | ||
| - config: | ||
| os: ubuntu-24.04 | ||
| pkgs: 'libboost-all-dev' | ||
| flags: '-DCMAKE_CXX_STANDARD=17 -DHIGHFIVE_TEST_BOOST:Bool=ON' | ||
| run_cond: "mpi" | ||
| - config: | ||
| os: ubuntu-22.04 | ||
| flags: '-DHIGHFIVE_TEST_BOOST=Off -DCMAKE_CXX_STANDARD=20 -DHIGHFIVE_HAS_CONCEPTS=On' | ||
| run_cond: "mpi" | ||
| - config: | ||
| os: ubuntu-24.04 | ||
| flags: '-DHIGHFIVE_TEST_BOOST=Off -DCMAKE_CXX_STANDARD=20 -DHIGHFIVE_HAS_CONCEPTS=On' | ||
| run_cond: "mpi" | ||
| if: ${{ github.env.RUN_SUITE == 'all' || contains(github.env.RUN_SUITE, matrix.config.run_cond) }} | ||
|
Check failure on line 93 in .github/workflows/ci.yml
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: "Install libraries" | ||
| run: | | ||
| sudo apt-get -qq update | ||
| sudo apt-get -qq install libhdf5-openmpi-dev libsz2 ninja-build ${{ matrix.config.pkgs }} | ||
| - name: Build | ||
| run: | | ||
| CMAKE_OPTIONS=(-DHDF5_PREFER_PARALLEL:BOOL=ON ${{ matrix.config.flags }}) | ||
| source $GITHUB_WORKSPACE/.github/build.sh | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ctest -j2 --output-on-failure -C $BUILD_TYPE | ||
| - name: Test No HDF5 Diagnositics | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG | ||
| - name: Examples | ||
| working-directory: ${{ github.workspace }}/build/src/examples | ||
| run: $GITHUB_WORKSPACE/.github/run_examples.sh | ||
| Linux_HDF5_Versions: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| # Always run oldest version | ||
| - hdf5_version: hdf5-1_8_23 | ||
| run_cond: "always" | ||
| # Additional versions for specific test suites | ||
| - hdf5_version: hdf5-1_10_11 | ||
| run_cond: "hdf5" | ||
| - hdf5_version: hdf5-1_12_3 | ||
| run_cond: "hdf5" | ||
| - hdf5_version: hdf5_1.14.6 | ||
| run_cond: "hdf5" | ||
| if: ${{ github.env.RUN_SUITE == 'all' || contains(github.env.RUN_SUITE, matrix.run_cond) }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: "Install libraries" | ||
| run: | | ||
| sudo apt-get -qq update | ||
| sudo apt-get -qq install ninja-build libsz2 zlib1g-dev libboost-all-dev | ||
| - name: Build HDF5 | ||
| run: | | ||
| wget https://github.com/HDFGroup/hdf5/archive/refs/tags/${{ matrix.hdf5_version }}.tar.gz --output-document hdf5.tar.gz | ||
| tar xf hdf5.tar.gz | ||
| mkdir -p hdf5-${{ matrix.hdf5_version }}/BUILD && cd hdf5-${{ matrix.hdf5_version }}/BUILD | ||
| cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.hdf5_version }} -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DUSE_LIBAEC=ON -DHDF5_BUILD_EXAMPLES=OFF -DBUILD_STATIC_LIBS=OFF -DBUILD_TESTING=OFF | ||
| ninja && ninja install | ||
| - name: Build | ||
| run: | | ||
| CMAKE_OPTIONS=( | ||
| -GNinja | ||
| -DHDF5_ROOT=$HOME/${{ matrix.hdf5_version }} | ||
| ) | ||
| source $GITHUB_WORKSPACE/.github/build.sh | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ctest -j2 --output-on-failure -C $BUILD_TYPE | ||
| - name: Test No HDF5 Diagnositics | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG | ||
| - name: Examples | ||
| working-directory: ${{ github.workspace }}/build/src/examples | ||
| run: $GITHUB_WORKSPACE/.github/run_examples.sh | ||
| Linux_Compilers: | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| CC: ${{ matrix.env.CC }} | ||
| CXX: ${{ matrix.env.CXX }} | ||
| pkgs: ${{ matrix.env.pkgs }} | ||
| strategy: | ||
| matrix: | ||
| os: ["ubuntu-24.04"] | ||
| env: [ | ||
| # Always run GCC and Clang with C++14 | ||
| { CC: gcc-14, CXX: g++-14, pkgs: "gcc-14 g++-14", run_cond: "always" }, | ||
| { CC: clang-18, CXX: clang++-18, pkgs: "clang-18", run_cond: "always" }, | ||
| # Additional compilers for specific test suites | ||
| { CC: gcc-9, CXX: g++-9, pkgs: "gcc-9 g++-9", run_cond: "compiler" } | ||
| ] | ||
| include: | ||
| - os: "ubuntu-22.04" | ||
| env: | ||
| CC: clang-11 | ||
| CXX: clang++-11 | ||
| pkgs: clang-11 | ||
| run_cond: "compiler" | ||
| if: ${{ github.env.RUN_SUITE == 'all' || contains(github.env.RUN_SUITE, matrix.env.run_cond) }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: "Install libraries" | ||
| run: | | ||
| sudo apt-get -qq update | ||
| sudo apt-get -qq install ${pkgs} | ||
| sudo apt-get -qq install libboost-all-dev libhdf5-dev libsz2 ninja-build | ||
| - name: Build | ||
| run: | | ||
| CMAKE_OPTIONS=(-DHIGHFIVE_TEST_BOOST=ON -GNinja) | ||
| source $GITHUB_WORKSPACE/.github/build.sh | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ctest -j2 --output-on-failure -C $BUILD_TYPE | ||
| - name: Test No HDF5 Diagnositics | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG | ||
| - name: Examples | ||
| working-directory: ${{ github.workspace }}/build/src/examples | ||
| run: $GITHUB_WORKSPACE/.github/run_examples.sh | ||
| Linux_Sanitizers: | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
| matrix: | ||
| env: [ | ||
| { CC: clang, CXX: clang++, HIGHFIVE_SANITIZER: address }, | ||
| { CC: clang, CXX: clang++, HIGHFIVE_SANITIZER: undefined }, | ||
| { CC: gcc, CXX: g++, HIGHFIVE_GLIBCXX_ASSERTIONS: On } | ||
| ] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: "Install libraries" | ||
| run: | | ||
| sudo apt-get -qq update | ||
| sudo apt-get -qq install boost1.83 libeigen3-dev libhdf5-dev libsz2 ninja-build | ||
| - name: Build | ||
| run: | | ||
| CMAKE_OPTIONS=( | ||
| -GNinja | ||
| -DHIGHFIVE_TEST_BOOST:BOOL=ON | ||
| -DHIGHFIVE_TEST_BOOST_SPAN:BOOL=ON | ||
| -DHIGHFIVE_TEST_EIGEN:BOOL=ON | ||
| -DHIGHFIVE_BUILD_DOCS:BOOL=FALSE | ||
| -DHIGHFIVE_GLIBCXX_ASSERTIONS=${HIGHFIVE_GLIBCXX_ASSERTIONS:-OFF} | ||
| -DHIGHFIVE_SANITIZER=${HIGHFIVE_SANITIZER:-OFF} | ||
| ) | ||
| source $GITHUB_WORKSPACE/.github/build.sh | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ctest -j2 --output-on-failure -C $BUILD_TYPE | ||
| - name: Test No HDF5 Diagnositics | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG | ||
| - name: Examples | ||
| working-directory: ${{ github.workspace }}/build/src/examples | ||
| run: $GITHUB_WORKSPACE/.github/run_examples.sh | ||
| CMake_Project: | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
| matrix: | ||
| parallelism: [serial, parallel] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: "Update Ubuntu" | ||
| run: | | ||
| sudo apt-get -qq update | ||
| - name: "Install common libraries" | ||
| run: | | ||
| sudo apt-get -qq install libboost-all-dev libsz2 ninja-build | ||
| - name: "Install serial HDF5" | ||
| if: matrix.parallelism == 'serial' | ||
| run: | | ||
| sudo apt-get -qq install libhdf5-dev | ||
| - name: "Install parallel HDF5" | ||
| if: matrix.parallelism == 'parallel' | ||
| run: | | ||
| sudo apt-get -qq install libhdf5-openmpi-dev | ||
| - name: "CMake Project Integration" | ||
| run: bash tests/cmake_integration/test_cmake_integration.sh | ||
| Benchmarks: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: "Install libraries" | ||
| run: | | ||
| sudo apt -y update | ||
| sudo apt -y install --no-install-recommends libhdf5-dev pkg-config | ||
| - name: "Build benchmarks" | ||
| working-directory: ${{ github.workspace }}/src/benchmarks | ||
| run: make | ||
| - run: time ${{ github.workspace }}/src/benchmarks/highfive_bench | ||
| OSX: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: ["macOS-14"] | ||
| cxxstd: ["14"] # Always run C++14 | ||
| run_cond: ["always"] # Default config runs always | ||
| include: | ||
| # Additional versions for specific test suites | ||
| - os: "macOS-14" | ||
| cxxstd: "17" | ||
| run_cond: "osx" | ||
| - os: "macOS-14" | ||
| cxxstd: "20" | ||
| run_cond: "osx" | ||
| - os: "macOS-13" | ||
| cxxstd: "20" | ||
| run_cond: "osx" | ||
| if: ${{ github.env.RUN_SUITE == 'all' || contains(github.env.RUN_SUITE, matrix.run_cond) }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: "Install libraries (OSX)" | ||
| run: brew install boost eigen hdf5 ninja xtensor | ||
| - name: Build | ||
| run: | | ||
| if (( ${{ matrix.cxxstd }} > 14 )) | ||
| then | ||
| TEST_XTENSOR=On | ||
| else | ||
| TEST_XTENSOR=Off | ||
| fi | ||
| CMAKE_OPTIONS=( | ||
| -GNinja | ||
| -DHIGHFIVE_TEST_BOOST:BOOL=ON | ||
| -DHIGHFIVE_TEST_EIGEN:BOOL=ON | ||
| -DHIGHFIVE_TEST_XTENSOR:BOOL=${TEST_XTENSOR} | ||
| -DHIGHFIVE_BUILD_DOCS:BOOL=FALSE | ||
| -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} | ||
| ) | ||
| source $GITHUB_WORKSPACE/.github/build.sh | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ctest -j2 --output-on-failure -C $BUILD_TYPE | ||
| - name: Test No HDF5 Diagnositics | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: | | ||
| ! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG | ||
| - name: Examples | ||
| working-directory: ${{ github.workspace }}/build/src/examples | ||
| run: $GITHUB_WORKSPACE/.github/run_examples.sh | ||
| Windows: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: ["windows-2022"] # Always run latest Windows | ||
| cxxstd: ["14"] # Always run C++14 | ||
| run_cond: ["always"] # Default config runs always | ||
| include: | ||
| # Additional configurations for specific test suites | ||
| - os: "windows-2019" | ||
| cxxstd: "14" | ||
| run_cond: "windows" | ||
| - os: "windows-2022" | ||
| cxxstd: "17" | ||
| run_cond: "windows" | ||
| - os: "windows-2022" | ||
| cxxstd: "20" | ||
| run_cond: "windows" | ||
| - os: "windows-2019" | ||
| cxxstd: "17" | ||
| run_cond: "windows" | ||
| - os: "windows-2019" | ||
| cxxstd: "20" | ||
| run_cond: "windows" | ||
| if: ${{ github.env.RUN_SUITE == 'all' || contains(github.env.RUN_SUITE, matrix.run_cond) }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - uses: mamba-org/setup-micromamba@v2 | ||
| with: | ||
| environment-file: .github/mamba_env_cxx${{ matrix.cxxstd }}.yaml | ||
| environment-name: win-test | ||
| - name: Build | ||
| shell: bash -l {0} | ||
| run: | | ||
| if (( ${{ matrix.cxxstd }} == 17 )) | ||
| then | ||
| XTENSOR_HEADER_VERSION=2 | ||
| else | ||
| # Both C++14 and C++20 use 0.26 | ||
| XTENSOR_HEADER_VERSION=1 | ||
| fi | ||
| CMAKE_OPTIONS=( | ||
| -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} | ||
| -DHIGHFIVE_UNIT_TESTS=ON | ||
| -DHIGHFIVE_TEST_BOOST:BOOL=ON | ||
| -DHIGHFIVE_TEST_EIGEN:BOOL=ON | ||
| -DHIGHFIVE_TEST_XTENSOR:BOOL=ON | ||
| -DHIGHFIVE_XTENSOR_HEADER_VERSION=$XTENSOR_HEADER_VERSION | ||
| ) | ||
| source $GITHUB_WORKSPACE/.github/build.sh | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| shell: bash -l {0} | ||
| run: | | ||
| ctest -j2 --output-on-failure -C $BUILD_TYPE | ||
| - name: Test No HDF5 Diagnositics | ||
| working-directory: ${{ github.workspace }}/build | ||
| shell: bash -l {0} | ||
| run: | | ||
| ! ctest --verbose -C $BUILD_TYPE | grep HDF5-DIAG | ||