From fe8481b68bb2ebc8e8b40abd250392717ada4745 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 22 Aug 2023 08:41:09 +0200 Subject: [PATCH] CI: use clang16 nightly builds (#469) * CI: use clang16 nightly builds * CI: linux: add CXX_STANDARD variable and set for builds * Tests: require newer catch2 version when using c++20, get latest catch2 v3 version for internal * CI: key4hep use AUTO for catch2 * CI: disable key4hep release based build --- .github/workflows/key4hep.yml | 9 +++++---- .github/workflows/test.yml | 12 ++++++++---- tests/unittests/CMakeLists.txt | 11 ++++++++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/key4hep.yml b/.github/workflows/key4hep.yml index 43f69ef67..5135b4741 100644 --- a/.github/workflows/key4hep.yml +++ b/.github/workflows/key4hep.yml @@ -13,8 +13,9 @@ jobs: strategy: fail-fast: false matrix: - release: ["sw.hsf.org/key4hep", - "sw-nightlies.hsf.org/key4hep"] + include: + - release: "sw-nightlies.hsf.org/key4hep" + RNTUPLE: ON steps: - uses: actions/checkout@v3 - uses: cvmfs-contrib/github-action-cvmfs@v3 @@ -30,8 +31,8 @@ jobs: -DCMAKE_INSTALL_PREFIX=../install \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \ - -DUSE_EXTERNAL_CATCH2=ON \ - -DENABLE_RNTUPLE=ON \ + -DUSE_EXTERNAL_CATCH2=AUTO \ + -DENABLE_RNTUPLE=${{ matrix.RNTUPLE }} \ -G Ninja .. echo "::endgroup::" echo "::group::Build" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 858d20849..3b30009df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,15 +13,19 @@ jobs: strategy: fail-fast: false matrix: + LCG: ["dev3/x86_64-el9-clang16-opt", + "dev4/x86_64-el9-clang16-opt"] + CXX_STANDARD: [20] RNTUPLE: [ON] - LCG: ["dev3/x86_64-centos7-clang12-opt", - "dev4/x86_64-centos7-gcc11-opt", - "dev4/x86_64-centos7-clang12-opt"] include: + - LCG: "dev4/x86_64-centos7-gcc11-opt" + CXX_STANDARD: 17 - LCG: "LCG_102/x86_64-centos7-clang12-opt" RNTUPLE: OFF + CXX_STANDARD: 17 - LCG: "LCG_102/x86_64-centos8-gcc11-opt" RNTUPLE: OFF + CXX_STANDARD: 17 steps: - uses: actions/checkout@v3 - uses: cvmfs-contrib/github-action-cvmfs@v3 @@ -35,7 +39,7 @@ jobs: cmake -DENABLE_SIO=ON \ -DENABLE_RNTUPLE=${{ matrix.RNTUPLE }} \ -DCMAKE_INSTALL_PREFIX=../install \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \ -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \ -DUSE_EXTERNAL_CATCH2=OFF \ -G Ninja .. diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index 04f1e019a..5d938ef6a 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -1,8 +1,13 @@ +if(CMAKE_CXX_STANDARD GREATER_EQUAL 20) + set(CATCH2_MIN_VERSION 3.4) +else() + set(CATCH2_MIN_VERSION 3.1) +endif() if(USE_EXTERNAL_CATCH2) if (USE_EXTERNAL_CATCH2 STREQUAL AUTO) - find_package(Catch2 3.1) + find_package(Catch2 ${CATCH2_MIN_VERSION}) else() - find_package(Catch2 3.1 REQUIRED) + find_package(Catch2 ${CATCH2_MIN_VERSION} REQUIRED) endif() endif() @@ -16,7 +21,7 @@ if(NOT Catch2_FOUND) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.1.0 + GIT_TAG v3.4.0 ) FetchContent_MakeAvailable(Catch2) set(CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras ${CMAKE_MODULE_PATH})