diff --git a/.github/workflows/extra.yml b/.github/workflows/extra.yml new file mode 100644 index 000000000..f69aa53a0 --- /dev/null +++ b/.github/workflows/extra.yml @@ -0,0 +1,98 @@ +name: extra + +on: + # Trigger the workflow on every push + push: + branches: + - '**' + tags: + - '**' + + # Trigger the workflow manually + workflow_dispatch: ~ + + # Trigger after public PR approved for CI + pull_request_target: + types: [labeled] + +jobs: + + # Run 'extra' build + build-gcc: + name: build + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} + + strategy: + max-parallel: 8 + fail-fast: false + matrix: + os: + - alpine-3.23 + - arch-20260104 + - debian-11.11 + - debian-12.12 + - debian-13.2 + - fedora-37 + - fedora-42 + - ubuntu-22.04 + - ubuntu-24.04 + - almalinux-9.7 + - almalinux-10.1 + preset: + - linux.gcc.all.relwithdebinfo + - linux.clang.all.relwithdebinfo + jobs: [ 4 ] + + runs-on: [self-hosted, Linux, platform-builder-docker-xl] + + container: + image: marcosbento/lumen:${{ matrix.os }} + options: --user root + + steps: + + - name: Display build context + run: | + echo "Working directory: ${{ github.workspace }}" + echo "Environment:" + echo "$(env)" + + - name: Checkout 'ecbuild' + uses: actions/checkout@v4 + with: + repository: ecmwf/ecbuild + path: ecbuild + + - name: Checkout 'ecflow' + uses: actions/checkout@v4 + with: + path: ecflow + + - name: Configure ecflow + run: | + cd ${RUNNER_WORKSPACE}/ecflow/ecflow + cmake --preset ${{ matrix.preset }} + + - name: Build ecflow + run: | + cd ${RUNNER_WORKSPACE}/ecflow/ecflow + cmake --build --preset ${{ matrix.preset }} --jobs ${{ matrix.jobs }} + + - name: Test ecflow + if: ${{ !always() }} # Disable until we have a stable build + run: | + cd ${RUNNER_WORKSPACE}/ecflow/ecflow + ctest --preset ${{ matrix.preset }} --output-on-failure -L nightly -j ${{ matrix.jobs }} + + - name: Lint ecflow + if: ${{ matrix.preset == 'linux.clang.all.relwithdebinfo' && matrix.os == 'ubuntu-24.04' && !always() }} # Disable until we have a stable build + run: | + cd ${RUNNER_WORKSPACE}/ecflow/ecflow + run-clang-tidy -j ${{ matrix.jobs }} -p ${RUNNER_WORKSPACE}/ecflow/ecflow/.deploy/build/${{ matrix.preset }} | tee clang-tidy-report.txt + + - name: Archive lint report + if: ${{ matrix.preset == 'linux.clang.all.relwithdebinfo' && matrix.os == 'ubuntu-24.04' && !always() }} # Disable until we have a stable build + uses: actions/upload-artifact@v4 + with: + name: cling-tidy-report + path: ${RUNNER_WORKSPACE}/ecflow/ecflow/clang-tidy-report.txt diff --git a/CMakePresets.json b/CMakePresets.json index a916e7963..0bdfa84aa 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -6,6 +6,74 @@ "patch": 0 }, "configurePresets": [ + { + "name" : "linux.gcc.all.relwithdebinfo", + "description" : "Build environment on 'Linux', compiled with 'GNU GCC'", + "generator" : "Ninja", + "binaryDir" : "${sourceDir}/.deploy/build/${presetName}", + "installDir" : "${sourceDir}/.deploy/install/${presetName}", + "condition" : { + "type": "equals", + "lhs" : "${hostSystemName}", + "rhs" : "Linux" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE" : "RelWithDebInfo", + "CMAKE_VERBOSE_MAKEFILE" : "ON", + "CMAKE_COLOR_DIAGNOSTICS" : "ON", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_C_COMPILER" : "gcc", + "CMAKE_CXX_COMPILER" : "g++", + "CPACK_PACKAGE_NAME" : "ecflow", + "ENABLE_TESTS" : "ON", + "ENABLE_ALL_TESTS" : "ON", + "ENABLE_DOCS" : "OFF", + "ENABLE_PYTHON" : "ON", + "ENABLE_SERVER" : "ON", + "ENABLE_SSL" : "ON", + "ENABLE_UDP" : "ON", + "ENABLE_HTTP" : "ON", + "ENABLE_UI" : "ON", + "ENABLE_STATIC_BOOST_LIBS" : "OFF", + "ENABLE_DEBIAN_PACKAGE" : "ON", + "Boost_INCLUDE_DIR" : "/usr/include" + }, + "environment" : {} + }, + { + "name" : "linux.clang.all.relwithdebinfo", + "description" : "Build environment on 'Linux', compiled with 'LLVM Clang'", + "generator" : "Ninja", + "binaryDir" : "${sourceDir}/.deploy/build/${presetName}", + "installDir" : "${sourceDir}/.deploy/install/${presetName}", + "condition" : { + "type": "equals", + "lhs" : "${hostSystemName}", + "rhs" : "Linux" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE" : "RelWithDebInfo", + "CMAKE_VERBOSE_MAKEFILE" : "ON", + "CMAKE_COLOR_DIAGNOSTICS" : "ON", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_C_COMPILER" : "clang", + "CMAKE_CXX_COMPILER" : "clang++", + "CPACK_PACKAGE_NAME" : "ecflow", + "ENABLE_TESTS" : "ON", + "ENABLE_ALL_TESTS" : "ON", + "ENABLE_DOCS" : "OFF", + "ENABLE_PYTHON" : "ON", + "ENABLE_SERVER" : "ON", + "ENABLE_SSL" : "ON", + "ENABLE_UDP" : "ON", + "ENABLE_HTTP" : "ON", + "ENABLE_UI" : "ON", + "ENABLE_STATIC_BOOST_LIBS" : "OFF", + "ENABLE_DEBIAN_PACKAGE" : "ON", + "Boost_INCLUDE_DIR" : "/usr/include" + }, + "environment" : {} + }, { "name": "linux.gcc.serveronly.relwithdebinfo", "description": "Build environment on 'Linux', compiled with 'GNU GCC'", @@ -42,13 +110,43 @@ } ], "buildPresets": [ + { + "name" : "linux.gcc.all.relwithdebinfo", + "configurePreset": "linux.gcc.all.relwithdebinfo" + }, + { + "name" : "linux.clang.all.relwithdebinfo", + "configurePreset": "linux.clang.all.relwithdebinfo" + }, { "name": "linux.gcc.serveronly.relwithdebinfo", "configurePreset": "linux.gcc.serveronly.relwithdebinfo" } ], "testPresets": [ - { + { + "name" : "linux.gcc.all.relwithdebinfo", + "configurePreset": "linux.gcc.all.relwithdebinfo", + "output" : { + "outputOnFailure": true + }, + "execution" : { + "noTestsAction": "error", + "stopOnFailure": true + } + }, + { + "name" : "linux.clang.all.relwithdebinfo", + "configurePreset": "linux.clang.all.relwithdebinfo", + "output" : { + "outputOnFailure": true + }, + "execution" : { + "noTestsAction": "error", + "stopOnFailure": true + } + }, + { "name": "linux.gcc.serveronly.relwithdebinfo", "configurePreset": "linux.gcc.serveronly.relwithdebinfo", "output": { diff --git a/cmake/CompilerOptions.cmake b/cmake/CompilerOptions.cmake index b0b61812d..d45e5b006 100644 --- a/cmake/CompilerOptions.cmake +++ b/cmake/CompilerOptions.cmake @@ -35,16 +35,6 @@ ecbuild_info( "CMAKE_C_COMPILER_VERSION : ${CMAKE_C_COMPILER_VERSION}") ecbuild_info( "CMAKE_CXX_COMPILER_ID : ${CMAKE_CXX_COMPILER_ID}") ecbuild_info( "CMAKE_CXX_COMPILER_VERSION : ${CMAKE_CXX_COMPILER_VERSION}") -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - # - # In case of using Clang 18.1+ in Linux, we disable the following error (present in Boost headers): - # - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18.1 AND CMAKE_SYSTEM_NAME STREQUAL "Linux") - ecbuild_add_cxx_flags("-Wno-enum-constexpr-conversion") - endif () - -endif() - ecbuild_info( "Selected built type: ${CMAKE_BUILD_TYPE}" ) if( CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" ) @@ -61,11 +51,12 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") ecbuild_add_cxx_flags("-ftemplate-depth=1024") # - # In case of using Clang 18.1+ in Linux, we disable the following error (present in Boost headers): + # In case of using Clang [18.1, 20[ in Linux, we disable the following error (present in Boost headers): # - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18.1 AND CMAKE_SYSTEM_NAME STREQUAL "Linux") + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18.1 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20 AND CMAKE_SYSTEM_NAME STREQUAL "Linux") ecbuild_add_cxx_flags("-Wno-enum-constexpr-conversion") endif () + endif() if (HAVE_WARNINGS)