From e9a1e17aed8b48b64adec420b1944cf7ccd5e95c Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 11:23:26 +0000 Subject: [PATCH 01/31] chore: use CPM for dependencies --- .devcontainer/devcontainer.json | 3 + CMakeLists.txt | 28 +--- cmake/dependencies.cpm.cmake | 164 ++++++++++++++++++++++ cmake/package-lock.cmake | 110 +++++++++++++++ external/CMakeLists.txt | 10 -- external/cliutils/CMakeLists.txt | 1 - external/cliutils/cli11/CMakeLists.txt | 14 -- external/cucumber/CMakeLists.txt | 2 - external/cucumber/gherkin/CMakeLists.txt | 20 --- external/cucumber/messages/CMakeLists.txt | 15 -- external/fmtlib/CMakeLists.txt | 1 - external/fmtlib/fmt/CMakeLists.txt | 7 - external/google/CMakeLists.txt | 5 - external/google/abseil/CMakeLists.txt | 11 -- external/google/googletest/CMakeLists.txt | 25 ---- external/google/re2/CMakeLists.txt | 10 -- external/jbeder/CMakeLists.txt | 1 - external/jbeder/yaml-cpp/CMakeLists.txt | 9 -- external/nlohmann/CMakeLists.txt | 1 - external/nlohmann/json/CMakeLists.txt | 10 -- external/zeux/CMakeLists.txt | 1 - external/zeux/pugixml/CMakeLists.txt | 6 - 22 files changed, 283 insertions(+), 171 deletions(-) create mode 100644 cmake/dependencies.cpm.cmake create mode 100644 cmake/package-lock.cmake delete mode 100644 external/cliutils/CMakeLists.txt delete mode 100644 external/cliutils/cli11/CMakeLists.txt delete mode 100644 external/cucumber/CMakeLists.txt delete mode 100644 external/cucumber/gherkin/CMakeLists.txt delete mode 100644 external/cucumber/messages/CMakeLists.txt delete mode 100644 external/fmtlib/CMakeLists.txt delete mode 100644 external/fmtlib/fmt/CMakeLists.txt delete mode 100644 external/google/CMakeLists.txt delete mode 100644 external/google/abseil/CMakeLists.txt delete mode 100644 external/google/googletest/CMakeLists.txt delete mode 100644 external/google/re2/CMakeLists.txt delete mode 100644 external/jbeder/CMakeLists.txt delete mode 100644 external/jbeder/yaml-cpp/CMakeLists.txt delete mode 100644 external/nlohmann/CMakeLists.txt delete mode 100644 external/nlohmann/json/CMakeLists.txt delete mode 100644 external/zeux/CMakeLists.txt delete mode 100644 external/zeux/pugixml/CMakeLists.txt diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eb3193f6..9d67bcd8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,5 +13,8 @@ "github.vscode-github-actions" ] } + }, + "remoteEnv": { + "CPM_SOURCE_CACHE": "~/cache/.cpm" } } diff --git a/CMakeLists.txt b/CMakeLists.txt index 61d7e4b2..fcf21c0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.24) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") project(cucumber-cpp-runner LANGUAGES C CXX VERSION 4.1.0) # x-release-please-version -include(ccr_test_helpers) +include(cmake/ccr_test_helpers.cmake) if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(CCR_STANDALONE On) @@ -24,6 +24,8 @@ option(CCR_USE_RE2 "Use the RE2 regex engine (fetched when CCR_FETCH_DEPS is set option(CCR_ENABLE_COVERAGE "Enable compiler flags for code coverage measurements" Off) option(CCR_ENABLE_TIME_PROFILE "Enable compiler flags for time profiling measurements" Off) +set(CUCUMBER_CPP_FETCH_DEPS ${CCR_FETCH_DEPS}) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (CCR_BUILD_TESTS) @@ -61,26 +63,8 @@ include(FetchContent) include(GNUInstallDirs) include(CTest) -if (CCR_FETCH_DEPS) - add_subdirectory(external) -else() - find_package(CLI11 REQUIRED) - find_package(nlohmann_json REQUIRED) - find_package(GTest REQUIRED) - find_package(pugixml REQUIRED) - find_package(cucumber_messages REQUIRED) - find_package(cucumber_gherkin REQUIRED) - find_package(fmt REQUIRED) - - if (CCR_BUILD_TESTS) - find_package(yaml-cpp REQUIRED) - endif() - - if (CCR_USE_RE2) - find_package(absl) - find_package(re2) - endif() -endif() +include(cmake/dependencies.cpm.cmake) +add_subdirectory(external) if (TARGET re2::re2) set(CCR_HAS_RE2 On) diff --git a/cmake/dependencies.cpm.cmake b/cmake/dependencies.cpm.cmake new file mode 100644 index 00000000..8e8544ed --- /dev/null +++ b/cmake/dependencies.cpm.cmake @@ -0,0 +1,164 @@ +# renovate: datasource=github-tags packageName=cpm-cmake/CPM.cmake versioning=semver +set(CPM_DOWNLOAD_TAG_DIGEST v0.43.1 456cb6754daaa010d57444d0c8ce6d95ecf006ab) +# renovate: datasource=github-tags packageName=cucumber/gherkin versioning=semver +set(CUCUMBER_GHERKIN_TAG_DIGEST v@42.0.0 f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8) +# renovate: datasource=github-tags packageName=google/googletest versioning=semver +set(GOOGLE_TEST_TAG_DIGEST v1.17.0 52eb8108c5bdec04579160ae17225d66034bd723) +# renovate: datasource=github-tags packageName=CLIUtils/CLI11 versioning=semver +set(CLI11_TAG_DIGEST v2.6.2 37bb6edc5317e99af72ef48405e65d9ca5218861) +# renovate: datasource=github-tags packageName=fmtlib/fmt versioning=semver +set(LIBFMT_TAG_DIGEST v12.1.0 407c905e45ad75fc29bf0f9bb7c5c2fd3475976f) +# renovate: datasource=github-tags packageName=zeux/pugixml versioning=semver +set(PUGIXML_TAG_DIGEST v1.15 ee86beb30e4973f5feffe3ce63bfa4fbadf72f38) +# renovate: datasource=github-tags packageName=abseil/abseil-cpp +set(ABSEIL_CPP_TAG_DIGEST 20250814.2 0cf0a5c9d12cc3783363ab20f11613e69fd04c9a) +# renovate: datasource=github-tags packageName=google/re2 +set(RE2_TAG_DIGEST 2025-08-12 0f6c07eae69151e606acb3d9232750c3442dff23) +# renovate: datasource=github-tags packageName=jbeder/yaml-cpp versioning=semver +set(YAML_CPP_TAG_DIGEST v0.9.0 56e3bb550c91fd7005566f19c079cb7a503223cf) + +function(ccr_resolve_tag_digest_version LIST_VAR PREFIX) + list(GET ${LIST_VAR} 0 _tag) + list(GET ${LIST_VAR} 1 _digest) + string(REGEX REPLACE "^v" "" _version "${_tag}") + set(${PREFIX}_TAG "${_tag}" PARENT_SCOPE) + set(${PREFIX}_DIGEST "${_digest}" PARENT_SCOPE) + set(${PREFIX}_VERSION "${_version}" PARENT_SCOPE) +endfunction() + +ccr_resolve_tag_digest_version(CPM_DOWNLOAD_TAG_DIGEST CPM_DOWNLOAD) +ccr_resolve_tag_digest_version(CUCUMBER_GHERKIN_TAG_DIGEST CUCUMBER_GHERKIN) +ccr_resolve_tag_digest_version(GOOGLE_TEST_TAG_DIGEST GOOGLE_TEST) +ccr_resolve_tag_digest_version(CLI11_TAG_DIGEST CLI11) +ccr_resolve_tag_digest_version(LIBFMT_TAG_DIGEST LIBFMT) +ccr_resolve_tag_digest_version(PUGIXML_TAG_DIGEST PUGIXML) +ccr_resolve_tag_digest_version(ABSEIL_CPP_TAG_DIGEST ABSEIL_CPP) +ccr_resolve_tag_digest_version(RE2_TAG_DIGEST RE2) +ccr_resolve_tag_digest_version(YAML_CPP_TAG_DIGEST YAML_CPP) + +if(CCR_FETCH_DEPS) + if(NOT COMMAND CPMAddPackage) + # --------------------------------------------------------------------------- + # CPM – download on first configure if not already cached (standalone only) + # --------------------------------------------------------------------------- + set(CPM_USE_LOCAL_PACKAGES ON) + set(CPM_DOWNLOAD_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") + + if(NOT EXISTS "${CPM_DOWNLOAD_LOCATION}") + message(STATUS "Downloading CPM.cmake ${CPM_DOWNLOAD_VERSION}…") + file(DOWNLOAD + "https://github.com/cpm-cmake/CPM.cmake/releases/download/${CPM_DOWNLOAD_TAG}/CPM.cmake" + "${CPM_DOWNLOAD_LOCATION}" + TLS_VERIFY ON + ) + endif() + + include("${CPM_DOWNLOAD_LOCATION}") + endif() + CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake) + + # --------------------------------------------------------------------------- + # + # Dependencies + # + # --------------------------------------------------------------------------- + + # --------------------------------------------------------------------------- + # cucumber_gherkin + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:cucumber/gherkin@${CUCUMBER_GHERKIN_VERSION}#${CUCUMBER_GHERKIN_DIGEST}" + NAME cucumber_gherkin + SOURCE_SUBDIR cpp + OPTIONS + "CUCUMBER_GHERKIN_FETCH_DEPS ON" + ) + + # --------------------------------------------------------------------------- + # GoogleTest + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:google/googletest@${GOOGLE_TEST_VERSION}#${GOOGLE_TEST_DIGEST}" + NAME googletest + OPTIONS + "INSTALL_GTEST OFF" + "gtest_force_shared_crt ON" + ) + + set_target_properties(gtest gtest_main gmock gmock_main PROPERTIES + FOLDER External/GoogleTest + ) + + # --------------------------------------------------------------------------- + # cli11 + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:CLIUtils/CLI11@${CLI11_VERSION}#${CLI11_DIGEST}" + NAME cli11 + ) + + # --------------------------------------------------------------------------- + # libfmt + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:fmtlib/fmt@${LIBFMT_VERSION}#${LIBFMT_DIGEST}" + NAME libfmt + ) + + # --------------------------------------------------------------------------- + # pugixml + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:zeux/pugixml@${PUGIXML_VERSION}#${PUGIXML_DIGEST}" + NAME pugixml + ) + + if (CCR_USE_RE2) + # --------------------------------------------------------------------------- + # abseil-cpp + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:abseil/abseil-cpp@${ABSEIL_CPP_VERSION}#${ABSEIL_CPP_DIGEST}" + NAME abseil-cpp + OPTIONS + "ABSL_PROPAGATE_CXX_STD ON" + "ABSL_ENABLE_INSTALL ON" + ) + + # --------------------------------------------------------------------------- + # re2 + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:google/re2#${RE2_DIGEST}" + NAME re2 + OPTIONS + "RE2_BUILD_TESTING OFF" + ) + endif() + + if (CCR_BUILD_TESTS) + # --------------------------------------------------------------------------- + # yaml-cpp + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:jbeder/yaml-cpp@${YAML_CPP_VERSION}#${YAML_CPP_DIGEST}" + NAME yaml-cpp + OPTION + "YAML_ENABLE_PIC OFF" + ) + endif() +else() + find_package(cucumber_gherkin ${CUCUMBER_GHERKIN_VERSION} REQUIRED) + find_package(GTest ${GOOGLE_TEST_VERSION} REQUIRED) + find_package(pugixml ${PUGIXML_VERSION} REQUIRED) + find_package(fmt ${LIBFMT_VERSION} REQUIRED) + + if (CCR_USE_RE2) + find_package(absl ${ABSEIL_CPP_VERSION}) + find_package(re2) + endif() + + if (CCR_BUILD_TESTS) + find_package(yaml-cpp ${YAML_CPP_VERSION} REQUIRED) + endif() +endif() diff --git a/cmake/package-lock.cmake b/cmake/package-lock.cmake new file mode 100644 index 00000000..b17be791 --- /dev/null +++ b/cmake/package-lock.cmake @@ -0,0 +1,110 @@ +# CPM Package Lock +# This file should be committed to version control + +# nlohmann_json +CPMDeclarePackage(nlohmann_json + NAME nlohmann_json + VERSION 3.12.0 + GIT_TAG 55f93686c01528224f448c19128836e7df245f72 + GITHUB_REPOSITORY nlohmann/json + SYSTEM YES + EXCLUDE_FROM_ALL YES + OPTIONS + "JSON_BuildTests Off" + "JSON_Install ON" +) +# cucumber_messages +CPMDeclarePackage(cucumber_messages + NAME cucumber_messages + VERSION 34.2.0 + GIT_TAG 073f951ce615149a1532185fbae013ad908a918e + GITHUB_REPOSITORY cucumber/messages + SYSTEM YES + EXCLUDE_FROM_ALL YES + SOURCE_SUBDIR cpp + OPTIONS + "CUCUMBER_MESSAGES_FETCH_DEPS ON" +) +# cucumber_gherkin +CPMDeclarePackage(cucumber_gherkin + NAME cucumber_gherkin + VERSION 42.0.0 + GIT_TAG f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8 + GITHUB_REPOSITORY cucumber/gherkin + SYSTEM YES + EXCLUDE_FROM_ALL YES + SOURCE_SUBDIR cpp + OPTIONS + "CUCUMBER_GHERKIN_FETCH_DEPS ON" +) +# googletest +CPMDeclarePackage(googletest + NAME googletest + VERSION 1.17.0 + GIT_TAG 52eb8108c5bdec04579160ae17225d66034bd723 + GITHUB_REPOSITORY google/googletest + SYSTEM YES + EXCLUDE_FROM_ALL YES + OPTIONS + "INSTALL_GTEST OFF" + "gtest_force_shared_crt ON" +) +# cli11 +CPMDeclarePackage(cli11 + NAME cli11 + VERSION 2.6.2 + GIT_TAG 37bb6edc5317e99af72ef48405e65d9ca5218861 + GITHUB_REPOSITORY CLIUtils/CLI11 + SYSTEM YES + EXCLUDE_FROM_ALL YES +) +# libfmt +CPMDeclarePackage(libfmt + NAME libfmt + VERSION 12.1.0 + GIT_TAG 407c905e45ad75fc29bf0f9bb7c5c2fd3475976f + GITHUB_REPOSITORY fmtlib/fmt + SYSTEM YES + EXCLUDE_FROM_ALL YES +) +# pugixml +CPMDeclarePackage(pugixml + NAME pugixml + VERSION 1.15 + GIT_TAG ee86beb30e4973f5feffe3ce63bfa4fbadf72f38 + GITHUB_REPOSITORY zeux/pugixml + SYSTEM YES + EXCLUDE_FROM_ALL YES +) +# abseil-cpp +CPMDeclarePackage(abseil-cpp + NAME abseil-cpp + VERSION 20250814.2 + GIT_TAG 0cf0a5c9d12cc3783363ab20f11613e69fd04c9a + GITHUB_REPOSITORY abseil/abseil-cpp + SYSTEM YES + EXCLUDE_FROM_ALL YES + OPTIONS + "ABSL_PROPAGATE_CXX_STD ON" + "ABSL_ENABLE_INSTALL ON" +) +# re2 (unversioned) +# CPMDeclarePackage(re2 +# NAME re2 +# GIT_TAG 0f6c07eae69151e606acb3d9232750c3442dff23 +# GITHUB_REPOSITORY google/re2 +# SYSTEM YES +# EXCLUDE_FROM_ALL YES +# OPTIONS +# "RE2_BUILD_TESTING OFF" +#) +# yaml-cpp +CPMDeclarePackage(yaml-cpp + NAME yaml-cpp + VERSION 0.9.0 + GIT_TAG 56e3bb550c91fd7005566f19c079cb7a503223cf + GITHUB_REPOSITORY jbeder/yaml-cpp + SYSTEM YES + EXCLUDE_FROM_ALL YES + OPTION YAML_ENABLE_PIC OFF +) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 6de30b50..9d8247d8 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,14 +1,4 @@ set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "") set(CMAKE_COMPILE_WARNING_AS_ERROR Off) -add_subdirectory(nlohmann) # before cucumber - -add_subdirectory(cliutils) -add_subdirectory(cucumber) -add_subdirectory(fmtlib) -add_subdirectory(google) -if (CCR_BUILD_TESTS) - add_subdirectory(jbeder) -endif() add_subdirectory(tobiaslocker) -add_subdirectory(zeux) diff --git a/external/cliutils/CMakeLists.txt b/external/cliutils/CMakeLists.txt deleted file mode 100644 index 148e407a..00000000 --- a/external/cliutils/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(cli11) diff --git a/external/cliutils/cli11/CMakeLists.txt b/external/cliutils/cli11/CMakeLists.txt deleted file mode 100644 index 3f54011e..00000000 --- a/external/cliutils/cli11/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -FetchContent_Declare( - cli11 - GIT_REPOSITORY https://github.com/CLIUtils/CLI11 - GIT_TAG 37bb6edc5317e99af72ef48405e65d9ca5218861 # v2.6.2 -) - -set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL On) - -# set(ARGS_BUILD_EXAMPLE Off CACHE INTERNAL "") -# set(ARGS_BUILD_UNITTESTS Off CACHE INTERNAL "") - -FetchContent_MakeAvailable(cli11) - -# set_target_properties(cli11 PROPERTIES FOLDER External/cli11) diff --git a/external/cucumber/CMakeLists.txt b/external/cucumber/CMakeLists.txt deleted file mode 100644 index 6c00ddcd..00000000 --- a/external/cucumber/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(messages) # before gherkin -add_subdirectory(gherkin) diff --git a/external/cucumber/gherkin/CMakeLists.txt b/external/cucumber/gherkin/CMakeLists.txt deleted file mode 100644 index 709755cc..00000000 --- a/external/cucumber/gherkin/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -FetchContent_Declare( - cucumber_gherkin - GIT_REPOSITORY https://github.com/cucumber/gherkin.git - GIT_TAG 6f0040fee2783fdb455d345e5bdb50d425515b5d # cpp-remove-cmate-use-native-cmake-and-CPM -) - -FetchContent_MakeAvailable(cucumber_gherkin) - -add_subdirectory(${cucumber_gherkin_SOURCE_DIR}/cpp ${cucumber_gherkin_BINARY_DIR}/cpp) - -# The usage of designated initializers requires c++20 in MSVC -set_target_properties(cucumber_gherkin_lib PROPERTIES CXX_STANDARD 20) -set_target_properties(cucumber_gherkin_bin PROPERTIES CXX_STANDARD 20) -set_target_properties(cucumber_gherkin_generate_tokens_bin PROPERTIES CXX_STANDARD 20) - -# Mark cucumber_gherkin_lib include directories as SYSTEM so that deprecation -# warnings in third-party headers (e.g. std::wstring_convert in utils.hpp) -# are not raised as errors in consuming targets. -get_target_property(_gherkin_includes cucumber_gherkin_lib INTERFACE_INCLUDE_DIRECTORIES) -set_target_properties(cucumber_gherkin_lib PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_gherkin_includes}") diff --git a/external/cucumber/messages/CMakeLists.txt b/external/cucumber/messages/CMakeLists.txt deleted file mode 100644 index 30df692c..00000000 --- a/external/cucumber/messages/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -FetchContent_Declare( - cucumber_messages - GIT_REPOSITORY https://github.com/cucumber/messages.git - GIT_TAG c34b8cf6412f274ac6943075326440b7e6062c81 # refactor-cpp-codegen - OVERRIDE_FIND_PACKAGE -) - -FetchContent_MakeAvailable(cucumber_messages) - -add_subdirectory(${cucumber_messages_SOURCE_DIR}/cpp ${cucumber_messages_BINARY_DIR}/cpp) - -target_compile_options(cucumber_messages_lib PUBLIC - # cucumber_gherkin-src/cpp/include/gherkin/cucumber/gherkin/utils.hpp:34:31: error: 'codecvt_utf8' is deprecated - $<$:-Wno-deprecated-declarations> -) diff --git a/external/fmtlib/CMakeLists.txt b/external/fmtlib/CMakeLists.txt deleted file mode 100644 index 468fe7de..00000000 --- a/external/fmtlib/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(fmt) diff --git a/external/fmtlib/fmt/CMakeLists.txt b/external/fmtlib/fmt/CMakeLists.txt deleted file mode 100644 index b5ad181c..00000000 --- a/external/fmtlib/fmt/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -FetchContent_Declare( - libfmt - GIT_REPOSITORY https://github.com/fmtlib/fmt - GIT_TAG 407c905e45ad75fc29bf0f9bb7c5c2fd3475976f # 12.1.0 -) - -FetchContent_MakeAvailable(libfmt) diff --git a/external/google/CMakeLists.txt b/external/google/CMakeLists.txt deleted file mode 100644 index b307909f..00000000 --- a/external/google/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -if (CCR_USE_RE2) - add_subdirectory(abseil) # before re2 - add_subdirectory(re2) -endif() -add_subdirectory(googletest) diff --git a/external/google/abseil/CMakeLists.txt b/external/google/abseil/CMakeLists.txt deleted file mode 100644 index 1713d7d4..00000000 --- a/external/google/abseil/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -FetchContent_Declare( - absl - GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git - GIT_TAG 0cf0a5c9d12cc3783363ab20f11613e69fd04c9a # 20250814.2 - OVERRIDE_FIND_PACKAGE -) - -set(ABSL_PROPAGATE_CXX_STD On CACHE BOOL "" FORCE) -set(ABSL_ENABLE_INSTALL On CACHE BOOL "" FORCE) - -FetchContent_MakeAvailable(absl) diff --git a/external/google/googletest/CMakeLists.txt b/external/google/googletest/CMakeLists.txt deleted file mode 100644 index 0934eba7..00000000 --- a/external/google/googletest/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -if(NOT TARGET gtest) - FetchContent_Declare( - googletest - GIT_REPOSITORY https://github.com/google/googletest - GIT_TAG 52eb8108c5bdec04579160ae17225d66034bd723 # v1.17.0 - ) - - set(gtest_force_shared_crt On CACHE BOOL "" FORCE) # For Windows: Prevent overriding the parent project's compiler/linker settings - set(INSTALL_GTEST Off CACHE BOOL "" FORCE) - - FetchContent_MakeAvailable(googletest) - - set_target_properties(gtest gtest_main gmock gmock_main PROPERTIES FOLDER External/GoogleTest) - - # clang-22 promoted -Wcharacter-conversion to an on-by-default warning - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 22.0.0) - target_compile_options(gtest INTERFACE -Wno-character-conversion) - target_compile_options(gtest_main INTERFACE -Wno-character-conversion) - target_compile_options(gmock INTERFACE -Wno-character-conversion) - target_compile_options(gmock_main INTERFACE -Wno-character-conversion) - endif() - endif() - mark_as_advanced(BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS gmock_build_tests gtest_build_samples test_build_tests gtest_disable_pthreads gtest_force_shared_crt gtest_hide_internal_symbols) -endif() diff --git a/external/google/re2/CMakeLists.txt b/external/google/re2/CMakeLists.txt deleted file mode 100644 index 0cd9b7e0..00000000 --- a/external/google/re2/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -FetchContent_Declare( - re2 - GIT_REPOSITORY https://github.com/google/re2.git - GIT_TAG 0f6c07eae69151e606acb3d9232750c3442dff23 # 2025-08-12 - OVERRIDE_FIND_PACKAGE -) - -set(RE2_BUILD_TESTING Off CACHE BOOL "" FORCE) - -FetchContent_MakeAvailable(re2) diff --git a/external/jbeder/CMakeLists.txt b/external/jbeder/CMakeLists.txt deleted file mode 100644 index 74eaddec..00000000 --- a/external/jbeder/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(yaml-cpp) diff --git a/external/jbeder/yaml-cpp/CMakeLists.txt b/external/jbeder/yaml-cpp/CMakeLists.txt deleted file mode 100644 index fe193f26..00000000 --- a/external/jbeder/yaml-cpp/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -FetchContent_Declare( - yaml-cpp - GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git - GIT_TAG 56e3bb550c91fd7005566f19c079cb7a503223cf # yaml-cpp-0.9.0 -) - -set(YAML_ENABLE_PIC OFF CACHE STRING "") - -FetchContent_MakeAvailable(yaml-cpp) diff --git a/external/nlohmann/CMakeLists.txt b/external/nlohmann/CMakeLists.txt deleted file mode 100644 index 7a340d53..00000000 --- a/external/nlohmann/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(json) diff --git a/external/nlohmann/json/CMakeLists.txt b/external/nlohmann/json/CMakeLists.txt deleted file mode 100644 index 9f4a28eb..00000000 --- a/external/nlohmann/json/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -FetchContent_Declare(nlohmann_json - GIT_REPOSITORY https://github.com/nlohmann/json.git - GIT_TAG 55f93686c01528224f448c19128836e7df245f72 # v3.12.0 - OVERRIDE_FIND_PACKAGE -) - -# required for cucumber/messages and cucumber/gherkin -set(JSON_Install "On") - -FetchContent_MakeAvailable(nlohmann_json) diff --git a/external/zeux/CMakeLists.txt b/external/zeux/CMakeLists.txt deleted file mode 100644 index 7cc8a3d5..00000000 --- a/external/zeux/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(pugixml) diff --git a/external/zeux/pugixml/CMakeLists.txt b/external/zeux/pugixml/CMakeLists.txt deleted file mode 100644 index a6df3dc8..00000000 --- a/external/zeux/pugixml/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -FetchContent_Declare(pugixml - GIT_REPOSITORY https://github.com/zeux/pugixml.git - GIT_TAG ee86beb30e4973f5feffe3ce63bfa4fbadf72f38 # v1.15 -) - -FetchContent_MakeAvailable(pugixml) From 963d80bb3f5442930fbd8bc8cb4c0e23e5c30f21 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 11:25:47 +0000 Subject: [PATCH 02/31] fix: correct CUCUMBER_GHERKIN_TAG_DIGEST format and refactor ccr_resolve_tag_digest_version function --- cmake/dependencies.cpm.cmake | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/cmake/dependencies.cpm.cmake b/cmake/dependencies.cpm.cmake index 8e8544ed..dc35c1cc 100644 --- a/cmake/dependencies.cpm.cmake +++ b/cmake/dependencies.cpm.cmake @@ -1,7 +1,7 @@ # renovate: datasource=github-tags packageName=cpm-cmake/CPM.cmake versioning=semver set(CPM_DOWNLOAD_TAG_DIGEST v0.43.1 456cb6754daaa010d57444d0c8ce6d95ecf006ab) # renovate: datasource=github-tags packageName=cucumber/gherkin versioning=semver -set(CUCUMBER_GHERKIN_TAG_DIGEST v@42.0.0 f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8) +set(CUCUMBER_GHERKIN_TAG_DIGEST v42.0.0 f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8) # renovate: datasource=github-tags packageName=google/googletest versioning=semver set(GOOGLE_TEST_TAG_DIGEST v1.17.0 52eb8108c5bdec04579160ae17225d66034bd723) # renovate: datasource=github-tags packageName=CLIUtils/CLI11 versioning=semver @@ -17,14 +17,11 @@ set(RE2_TAG_DIGEST 2025-08-12 0f6c07eae69151e606acb3d9232750c3442df # renovate: datasource=github-tags packageName=jbeder/yaml-cpp versioning=semver set(YAML_CPP_TAG_DIGEST v0.9.0 56e3bb550c91fd7005566f19c079cb7a503223cf) -function(ccr_resolve_tag_digest_version LIST_VAR PREFIX) - list(GET ${LIST_VAR} 0 _tag) - list(GET ${LIST_VAR} 1 _digest) - string(REGEX REPLACE "^v" "" _version "${_tag}") - set(${PREFIX}_TAG "${_tag}" PARENT_SCOPE) - set(${PREFIX}_DIGEST "${_digest}" PARENT_SCOPE) - set(${PREFIX}_VERSION "${_version}" PARENT_SCOPE) -endfunction() +macro(ccr_resolve_tag_digest_version LIST_VAR PREFIX) + list(GET ${LIST_VAR} 0 ${PREFIX}_TAG) + list(GET ${LIST_VAR} 1 ${PREFIX}_DIGEST) + string(REGEX REPLACE "^v" "" ${PREFIX}_VERSION "${${PREFIX}_TAG}") +endmacro() ccr_resolve_tag_digest_version(CPM_DOWNLOAD_TAG_DIGEST CPM_DOWNLOAD) ccr_resolve_tag_digest_version(CUCUMBER_GHERKIN_TAG_DIGEST CUCUMBER_GHERKIN) @@ -55,7 +52,7 @@ if(CCR_FETCH_DEPS) include("${CPM_DOWNLOAD_LOCATION}") endif() - CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake) + # CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake) # --------------------------------------------------------------------------- # From b70ac5e98a269ff4b8ba1a8b24db8997304d777e Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 11:30:01 +0000 Subject: [PATCH 03/31] refactor: simplify dependency declarations using ccr_dependency macro --- cmake/dependencies.cpm.cmake | 40 ++++++++++++++---------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/cmake/dependencies.cpm.cmake b/cmake/dependencies.cpm.cmake index dc35c1cc..478a657f 100644 --- a/cmake/dependencies.cpm.cmake +++ b/cmake/dependencies.cpm.cmake @@ -1,37 +1,27 @@ +macro(ccr_dependency PREFIX TAG DIGEST) + set(${PREFIX}_TAG "${TAG}") + set(${PREFIX}_DIGEST "${DIGEST}") + string(REGEX REPLACE "^v" "" ${PREFIX}_VERSION "${TAG}") +endmacro() + # renovate: datasource=github-tags packageName=cpm-cmake/CPM.cmake versioning=semver -set(CPM_DOWNLOAD_TAG_DIGEST v0.43.1 456cb6754daaa010d57444d0c8ce6d95ecf006ab) +ccr_dependency(CPM_DOWNLOAD v0.43.1 456cb6754daaa010d57444d0c8ce6d95ecf006ab) # renovate: datasource=github-tags packageName=cucumber/gherkin versioning=semver -set(CUCUMBER_GHERKIN_TAG_DIGEST v42.0.0 f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8) +ccr_dependency(CUCUMBER_GHERKIN v42.0.0 f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8) # renovate: datasource=github-tags packageName=google/googletest versioning=semver -set(GOOGLE_TEST_TAG_DIGEST v1.17.0 52eb8108c5bdec04579160ae17225d66034bd723) +ccr_dependency(GOOGLE_TEST v1.17.0 52eb8108c5bdec04579160ae17225d66034bd723) # renovate: datasource=github-tags packageName=CLIUtils/CLI11 versioning=semver -set(CLI11_TAG_DIGEST v2.6.2 37bb6edc5317e99af72ef48405e65d9ca5218861) +ccr_dependency(CLI11 v2.6.2 37bb6edc5317e99af72ef48405e65d9ca5218861) # renovate: datasource=github-tags packageName=fmtlib/fmt versioning=semver -set(LIBFMT_TAG_DIGEST v12.1.0 407c905e45ad75fc29bf0f9bb7c5c2fd3475976f) +ccr_dependency(LIBFMT v12.1.0 407c905e45ad75fc29bf0f9bb7c5c2fd3475976f) # renovate: datasource=github-tags packageName=zeux/pugixml versioning=semver -set(PUGIXML_TAG_DIGEST v1.15 ee86beb30e4973f5feffe3ce63bfa4fbadf72f38) +ccr_dependency(PUGIXML v1.15 ee86beb30e4973f5feffe3ce63bfa4fbadf72f38) # renovate: datasource=github-tags packageName=abseil/abseil-cpp -set(ABSEIL_CPP_TAG_DIGEST 20250814.2 0cf0a5c9d12cc3783363ab20f11613e69fd04c9a) +ccr_dependency(ABSEIL_CPP 20250814.2 0cf0a5c9d12cc3783363ab20f11613e69fd04c9a) # renovate: datasource=github-tags packageName=google/re2 -set(RE2_TAG_DIGEST 2025-08-12 0f6c07eae69151e606acb3d9232750c3442dff23) +ccr_dependency(RE2 2025-08-12 0f6c07eae69151e606acb3d9232750c3442dff23) # renovate: datasource=github-tags packageName=jbeder/yaml-cpp versioning=semver -set(YAML_CPP_TAG_DIGEST v0.9.0 56e3bb550c91fd7005566f19c079cb7a503223cf) - -macro(ccr_resolve_tag_digest_version LIST_VAR PREFIX) - list(GET ${LIST_VAR} 0 ${PREFIX}_TAG) - list(GET ${LIST_VAR} 1 ${PREFIX}_DIGEST) - string(REGEX REPLACE "^v" "" ${PREFIX}_VERSION "${${PREFIX}_TAG}") -endmacro() - -ccr_resolve_tag_digest_version(CPM_DOWNLOAD_TAG_DIGEST CPM_DOWNLOAD) -ccr_resolve_tag_digest_version(CUCUMBER_GHERKIN_TAG_DIGEST CUCUMBER_GHERKIN) -ccr_resolve_tag_digest_version(GOOGLE_TEST_TAG_DIGEST GOOGLE_TEST) -ccr_resolve_tag_digest_version(CLI11_TAG_DIGEST CLI11) -ccr_resolve_tag_digest_version(LIBFMT_TAG_DIGEST LIBFMT) -ccr_resolve_tag_digest_version(PUGIXML_TAG_DIGEST PUGIXML) -ccr_resolve_tag_digest_version(ABSEIL_CPP_TAG_DIGEST ABSEIL_CPP) -ccr_resolve_tag_digest_version(RE2_TAG_DIGEST RE2) -ccr_resolve_tag_digest_version(YAML_CPP_TAG_DIGEST YAML_CPP) +ccr_dependency(YAML_CPP v0.9.0 56e3bb550c91fd7005566f19c079cb7a503223cf) if(CCR_FETCH_DEPS) if(NOT COMMAND CPMAddPackage) From cc8c4d306b948b498ea0ec5f4fdb372b4ba4d20c Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 11:30:22 +0000 Subject: [PATCH 04/31] fix: uncomment CPMUsePackageLock to enable package locking --- cmake/dependencies.cpm.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/dependencies.cpm.cmake b/cmake/dependencies.cpm.cmake index 478a657f..1d3af179 100644 --- a/cmake/dependencies.cpm.cmake +++ b/cmake/dependencies.cpm.cmake @@ -42,7 +42,7 @@ if(CCR_FETCH_DEPS) include("${CPM_DOWNLOAD_LOCATION}") endif() - # CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake) + CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake) # --------------------------------------------------------------------------- # From 0df8ec8affc04cf1fc35c3fd0a89ab55895d789c Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 11:54:18 +0000 Subject: [PATCH 05/31] fix: ensure compile warnings are treated as errors in standalone mode --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fcf21c0d..f1952da0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ endif() if (CCR_STANDALONE) set(CCR_DEFAULTOPT On) set(CCR_EXCLUDE_FROM_ALL "") - set(CMAKE_COMPILE_WARNING_AS_ERROR On) else() set(CCR_DEFAULTOPT Off) set(CCR_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL") @@ -83,6 +82,7 @@ if (CCR_STANDALONE AND NOT CCR_ENABLE_COVERAGE) endif() endif() +set(CMAKE_COMPILE_WARNING_AS_ERROR On) add_subdirectory(cucumber_cpp) if (CCR_STANDALONE) From ffbdb65cc01154fb9cf2fc55bd69b7f751707e8d Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 11:55:02 +0000 Subject: [PATCH 06/31] fix: update conditions for sanitizer flags and warning errors in top-level project --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1952da0..19651e53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,16 +75,19 @@ endif() # libraries (abseil, re2) are not compiled with sanitizer instrumentation. # Abseil's constexpr function-pointer comparisons are not compatible with GCC's # ASan/UBSan instrumentation, which causes build failures. -if (CCR_STANDALONE AND NOT CCR_ENABLE_COVERAGE) +if (PROJECT_IS_TOP_LEVEL AND NOT CCR_ENABLE_COVERAGE) if (NOT (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")) add_compile_options(-fsanitize=address -fsanitize=undefined) add_link_options(-fsanitize=address -fsanitize=undefined) endif() endif() -set(CMAKE_COMPILE_WARNING_AS_ERROR On) +if(PROJECT_IS_TOP_LEVEL) + set(CMAKE_COMPILE_WARNING_AS_ERROR On) +endif() + add_subdirectory(cucumber_cpp) -if (CCR_STANDALONE) +if (PROJECT_IS_TOP_LEVEL) add_subdirectory(compatibility) endif() From 9622e5c37ac1433d144da5e9f39a555fb63b8f47 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 12:02:04 +0000 Subject: [PATCH 07/31] fix: add caching for CPM packages and ccache in CI workflows --- .github/workflows/ci.yml | 51 +++++++++++++++++++++++---- .github/workflows/static-analysis.yml | 36 ++++++++++++++++--- 2 files changed, 76 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 416eb6a2..493fd498 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,9 @@ concurrency: env: GTEST_COLOR: 1 + CCACHE_BASEDIR: ${{ github.workspace }} + CCACHE_DIR: ${{ github.workspace }}/.ccache + CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm jobs: build-in-devcontainer: @@ -33,23 +36,37 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false + - if: ${{ matrix.target == 'Windows' }} uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 id: cache-winsdk with: path: /winsdk key: cache-winsdk-10.0.26100-14.43.17.13 + - if: ${{ matrix.target == 'Windows' && steps.cache-winsdk.outputs.cache-hit != 'true' }} run: ./get-winsdk.sh + - if: ${{ matrix.target == 'Windows' && steps.cache-winsdk.outputs.cache-hit != 'true' && github.event_name != 'pull_request' }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: /winsdk key: cache-winsdk-10.0.26100-14.43.17.13 - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + + - name: Cache CPM packages + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: - key: ${{ github.job }}-${{ matrix.target }} - max-size: 2G + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + + - name: Cache ccache + if: "!startsWith(matrix.target, 'Windows')" + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ github.job }}-${{ matrix.target }}-${{ github.ref }} + restore-keys: ccache-${{ github.job }}-${{ matrix.target }}- + - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "${{ matrix.target}}" @@ -68,16 +85,29 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + + - name: Cache CPM packages + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: - key: ${{ github.job }} - max-size: 2G + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + + - name: Cache ccache + if: "!startsWith(matrix.target, 'Windows')" + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ github.job }}-${{ github.ref }} + restore-keys: ccache-${{ github.job }}- + - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "Host" buildPreset: "Host-Debug" + - run: | bats --formatter junit cucumber_cpp/acceptance_test/test.bats | tee test-report.xml + - uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 if: always() with: @@ -97,13 +127,22 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false + + - name: Cache CPM packages + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 with: key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.type }}${{ matrix.preset_suffix }} max-size: 2G + - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: workflowPreset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" + - name: Upload test logs if: ${{ failure() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index a3e56536..3ddc0c12 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -14,6 +14,11 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true +env: + CCACHE_BASEDIR: ${{ github.workspace }} + CCACHE_DIR: ${{ github.workspace }}/.ccache + CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm + jobs: sonar: name: SonarCloud @@ -27,10 +32,18 @@ jobs: fetch-depth: 0 # Disable shallow clone to enable blame information persist-credentials: false - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + - name: Cache CPM packages + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + + - name: Cache ccache + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: - key: ${{ github.job }} - max-size: 2G + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ github.job }}-${{ github.ref }} + restore-keys: ccache-${{ github.job }}- - name: Build for coverage uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 @@ -73,14 +86,27 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + + - name: Cache CPM packages + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: - key: ${{ github.job }} + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + + - name: Cache ccache + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ github.job }}-${{ github.ref }} + restore-keys: ccache-${{ github.job }}- + - uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 with: languages: cpp + - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "Host" buildPreset: "Host-Debug" + - uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 From ef4b5de5da1a416b085cfef80f13ec3414c08a28 Mon Sep 17 00:00:00 2001 From: Daan Timmer <8293597+daantimmer@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:12:20 +0200 Subject: [PATCH 08/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 493fd498..5ae76b6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,7 +90,7 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache if: "!startsWith(matrix.target, 'Windows')" From f0fdddc24e7c6ec088a15fa45580e5ef1702fc2b Mon Sep 17 00:00:00 2001 From: Daan Timmer <8293597+daantimmer@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:12:30 +0200 Subject: [PATCH 09/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/static-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 3ddc0c12..f02af5ff 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -36,7 +36,7 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 From c558b66ad307d993eea3b52a61197afbd7ca609b Mon Sep 17 00:00:00 2001 From: Daan Timmer <8293597+daantimmer@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:12:40 +0200 Subject: [PATCH 10/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/static-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index f02af5ff..10d29aa9 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -91,7 +91,7 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 From e7aa7304f38c465486567edf85d02c05bb7d80a7 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 13:15:02 +0000 Subject: [PATCH 11/31] fix: add logging for current and URI paths in BaseCompatibility --- compatibility/BaseCompatibility.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compatibility/BaseCompatibility.cpp b/compatibility/BaseCompatibility.cpp index aae24f9c..0368e578 100644 --- a/compatibility/BaseCompatibility.cpp +++ b/compatibility/BaseCompatibility.cpp @@ -14,6 +14,8 @@ #include "nlohmann/json_fwd.hpp" #include #include +#include +#include #include #include #include @@ -70,6 +72,9 @@ namespace compatibility uri = std::regex_replace(uri, std::regex(R"(samples\/[^\/]+)"), devkit.folder); uri = std::regex_replace(uri, std::regex(R"(\.ts$)"), ".cpp"); + fmt::println("current path: {}", std::filesystem::current_path().string()); + fmt::println(" uri path: {}", uri); + json[key] = std::filesystem::canonical(uri).string(); ++jsonIter; From acace837d7a6b5e14e6ebd5902f2b3923a74cef4 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 13:50:19 +0000 Subject: [PATCH 12/31] feat: add verbose output option and logging for step registration --- CMakePresets.json | 3 ++- cucumber_cpp/library/support/StepRegistry.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 4e9f5dca..277adfed 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -190,7 +190,8 @@ "name": "defaults", "hidden": true, "output": { - "outputOnFailure": true + "outputOnFailure": true, + "verbosity": "verbose" }, "execution": { "noTestsAction": "error", diff --git a/cucumber_cpp/library/support/StepRegistry.cpp b/cucumber_cpp/library/support/StepRegistry.cpp index 78a6410e..8fb1fb9a 100644 --- a/cucumber_cpp/library/support/StepRegistry.cpp +++ b/cucumber_cpp/library/support/StepRegistry.cpp @@ -13,6 +13,7 @@ #include "cucumber_cpp/library/support/UndefinedParameters.hpp" #include "cucumber_cpp/library/util/StepFactory.hpp" #include +#include #include #include #include @@ -100,6 +101,8 @@ namespace cucumber_cpp::library::support ? ExpressionPatternType::regularExpression : ExpressionPatternType::cucumberExpression; + fmt::println("Registering step definition@{}", sourceLocation.file_name()); + registry.emplace_back(factory, id, sourceLocation.line(), From b9cccbf2c943c606cac5c5b03b5b6452ece15137 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 14:07:27 +0000 Subject: [PATCH 13/31] feat: add logging for source location in DefinitionRegistration and StepRegistry --- cucumber_cpp/library/support/DefinitionRegistration.cpp | 2 ++ cucumber_cpp/library/support/DefinitionRegistration.hpp | 2 ++ cucumber_cpp/library/support/StepRegistry.hpp | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cucumber_cpp/library/support/DefinitionRegistration.cpp b/cucumber_cpp/library/support/DefinitionRegistration.cpp index f331c71b..4ff3c549 100644 --- a/cucumber_cpp/library/support/DefinitionRegistration.cpp +++ b/cucumber_cpp/library/support/DefinitionRegistration.cpp @@ -8,6 +8,7 @@ #include "cucumber_cpp/library/util/HookFactory.hpp" #include "cucumber_cpp/library/util/StepFactory.hpp" #include +#include #include #include #include @@ -75,6 +76,7 @@ namespace cucumber_cpp::library::support std::size_t DefinitionRegistration::Register(std::string_view matcher, StepType stepType, util::StepFactory factory, std::source_location sourceLocation) { + fmt::println("DefinitionRegistration::Register: {}", sourceLocation.file_name()); registry.try_emplace(sourceLocation, StepStringRegistration::Entry{ stepType, std::string{ matcher }, factory, sourceLocation }); return registry.size(); } diff --git a/cucumber_cpp/library/support/DefinitionRegistration.hpp b/cucumber_cpp/library/support/DefinitionRegistration.hpp index 6f1b9a33..80c14104 100644 --- a/cucumber_cpp/library/support/DefinitionRegistration.hpp +++ b/cucumber_cpp/library/support/DefinitionRegistration.hpp @@ -10,6 +10,7 @@ #include "cucumber_cpp/library/util/HookFactory.hpp" #include "cucumber_cpp/library/util/StepFactory.hpp" #include +#include #include #include #include @@ -96,6 +97,7 @@ namespace cucumber_cpp::library::support template std::size_t DefinitionRegistration::Register(std::string_view matcher, StepType stepType, std::source_location sourceLocation) { + fmt::println("DefinitionRegistration::Register: {}", sourceLocation.file_name()); return Instance().Register(matcher, stepType, util::StepBodyFactory, sourceLocation); } diff --git a/cucumber_cpp/library/support/StepRegistry.hpp b/cucumber_cpp/library/support/StepRegistry.hpp index 9b07c30d..6011f847 100644 --- a/cucumber_cpp/library/support/StepRegistry.hpp +++ b/cucumber_cpp/library/support/StepRegistry.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -136,7 +137,9 @@ namespace cucumber_cpp::library::support , regex{ std::move(regex) } , factory{ factory } , sourceLocation{ sourceLocation } - {} + { + fmt::println("StepStringRegistration::Entry: {}", sourceLocation.file_name()); + } StepType type{}; std::string regex; From 81bf8ef023926c561de015793e3104cc3acaac2d Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 14:30:00 +0000 Subject: [PATCH 14/31] fix: update CMakeLists.txt to use absolute paths for source files and improve compatibility kit source inclusion --- compatibility/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index f65ce043..01026ef2 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -13,6 +13,16 @@ target_include_directories(compatibility.base PUBLIC $ ) +# if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") +# # Normalize __FILE__ / std::source_location::file_name() to always use absolute +# # paths. GCC may pass source files to the compiler as paths relative to the build +# # directory; -ffile-prefix-map remaps that relative prefix back to the absolute +# # source directory so the result is consistent across compilers and versions. +# file(RELATIVE_PATH _ccr_src_relative_to_build "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}") +# add_compile_options("-ffile-prefix-map=${_ccr_src_relative_to_build}=${CMAKE_SOURCE_DIR}") +# unset(_ccr_src_relative_to_build) +# endif() + function(add_compatibility_kit name) set(libname compatibility.${name}.test) add_executable(${libname}) @@ -37,7 +47,7 @@ function(add_compatibility_kit name) if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${name}/${name}.cpp) target_sources(${libname} PRIVATE - ${name}/${name}.cpp + ${CMAKE_CURRENT_LIST_DIR}/${name}/${name}.cpp ) else() set(SKIP_TEST On) From af486c0b09c178ce435f75c86bad6fdff711fb76 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 14:39:04 +0000 Subject: [PATCH 15/31] fix: restore absolute path normalization for source files in CMakeLists.txt --- compatibility/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index 01026ef2..1fcee2b9 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -13,15 +13,15 @@ target_include_directories(compatibility.base PUBLIC $ ) -# if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") -# # Normalize __FILE__ / std::source_location::file_name() to always use absolute -# # paths. GCC may pass source files to the compiler as paths relative to the build -# # directory; -ffile-prefix-map remaps that relative prefix back to the absolute -# # source directory so the result is consistent across compilers and versions. -# file(RELATIVE_PATH _ccr_src_relative_to_build "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}") -# add_compile_options("-ffile-prefix-map=${_ccr_src_relative_to_build}=${CMAKE_SOURCE_DIR}") -# unset(_ccr_src_relative_to_build) -# endif() +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") + # Normalize __FILE__ / std::source_location::file_name() to always use absolute + # paths. GCC may pass source files to the compiler as paths relative to the build + # directory; -ffile-prefix-map remaps that relative prefix back to the absolute + # source directory so the result is consistent across compilers and versions. + file(RELATIVE_PATH _ccr_src_relative_to_build "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}") + add_compile_options("-ffile-prefix-map=${_ccr_src_relative_to_build}=${CMAKE_SOURCE_DIR}") + unset(_ccr_src_relative_to_build) +endif() function(add_compatibility_kit name) set(libname compatibility.${name}.test) @@ -47,7 +47,7 @@ function(add_compatibility_kit name) if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${name}/${name}.cpp) target_sources(${libname} PRIVATE - ${CMAKE_CURRENT_LIST_DIR}/${name}/${name}.cpp + ${name}/${name}.cpp ) else() set(SKIP_TEST On) From 1d64c821c45026ab89b2b1fa8baad19d6417f57c Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 14:59:33 +0000 Subject: [PATCH 16/31] feat: add compile definitions for source and binary directories in CMakeLists.txt and log paths in BaseCompatibility --- CMakeLists.txt | 3 +++ compatibility/BaseCompatibility.cpp | 2 ++ compatibility/CMakeLists.txt | 10 ---------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19651e53..dc06c959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,9 @@ if(PROJECT_IS_TOP_LEVEL) set(CMAKE_COMPILE_WARNING_AS_ERROR On) endif() +add_compile_definitions(-DCCR_SOURCE_DIR="${CMAKE_SOURCE_DIR}") +add_compile_definitions(-DCCR_BINARY_DIR="${CMAKE_BINARY_DIR}") + add_subdirectory(cucumber_cpp) if (PROJECT_IS_TOP_LEVEL) diff --git a/compatibility/BaseCompatibility.cpp b/compatibility/BaseCompatibility.cpp index 0368e578..e26a0c31 100644 --- a/compatibility/BaseCompatibility.cpp +++ b/compatibility/BaseCompatibility.cpp @@ -73,6 +73,8 @@ namespace compatibility uri = std::regex_replace(uri, std::regex(R"(\.ts$)"), ".cpp"); fmt::println("current path: {}", std::filesystem::current_path().string()); + fmt::println(" base path: {}", CCR_SOURCE_DIR); + fmt::println(" binary path: {}", CCR_BINARY_DIR); fmt::println(" uri path: {}", uri); json[key] = std::filesystem::canonical(uri).string(); diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index 1fcee2b9..f65ce043 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -13,16 +13,6 @@ target_include_directories(compatibility.base PUBLIC $ ) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") - # Normalize __FILE__ / std::source_location::file_name() to always use absolute - # paths. GCC may pass source files to the compiler as paths relative to the build - # directory; -ffile-prefix-map remaps that relative prefix back to the absolute - # source directory so the result is consistent across compilers and versions. - file(RELATIVE_PATH _ccr_src_relative_to_build "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}") - add_compile_options("-ffile-prefix-map=${_ccr_src_relative_to_build}=${CMAKE_SOURCE_DIR}") - unset(_ccr_src_relative_to_build) -endif() - function(add_compatibility_kit name) set(libname compatibility.${name}.test) add_executable(${libname}) From 00ab02e8e250ac44b8a376b5a4e5e688f1a049fe Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 15:09:27 +0000 Subject: [PATCH 17/31] refactor: remove compile definitions for source and binary directories in CMakeLists.txt and update BaseCompatibility to use relative paths --- CMakeLists.txt | 3 --- compatibility/BaseCompatibility.cpp | 9 ++++----- compatibility/CMakeLists.txt | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc06c959..19651e53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,9 +86,6 @@ if(PROJECT_IS_TOP_LEVEL) set(CMAKE_COMPILE_WARNING_AS_ERROR On) endif() -add_compile_definitions(-DCCR_SOURCE_DIR="${CMAKE_SOURCE_DIR}") -add_compile_definitions(-DCCR_BINARY_DIR="${CMAKE_BINARY_DIR}") - add_subdirectory(cucumber_cpp) if (PROJECT_IS_TOP_LEVEL) diff --git a/compatibility/BaseCompatibility.cpp b/compatibility/BaseCompatibility.cpp index e26a0c31..7cb130c3 100644 --- a/compatibility/BaseCompatibility.cpp +++ b/compatibility/BaseCompatibility.cpp @@ -72,12 +72,11 @@ namespace compatibility uri = std::regex_replace(uri, std::regex(R"(samples\/[^\/]+)"), devkit.folder); uri = std::regex_replace(uri, std::regex(R"(\.ts$)"), ".cpp"); - fmt::println("current path: {}", std::filesystem::current_path().string()); - fmt::println(" base path: {}", CCR_SOURCE_DIR); - fmt::println(" binary path: {}", CCR_BINARY_DIR); - fmt::println(" uri path: {}", uri); + std::filesystem::path path{ uri }; + if (path.is_relative()) + path = std::filesystem::path{ CCR_BINARY_DIR } / path; - json[key] = std::filesystem::canonical(uri).string(); + json[key] = std::filesystem::canonical(path).string(); ++jsonIter; } diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index f65ce043..608a9597 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -51,6 +51,7 @@ function(add_compatibility_kit name) KIT_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}/${name}" KIT_NDJSON_FILE="${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.ndjson" $<$:SKIP_TEST> + CCR_BINARY_DIR="${CMAKE_BINARY_DIR}" ) endfunction() From 318583cc7f9c8fcf2b59978e3bcedbd353407840 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Tue, 21 Jul 2026 15:30:49 +0000 Subject: [PATCH 18/31] feat: add compile definitions for CCR_BINARY_DIR in compatibility.base target --- compatibility/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index 608a9597..12e6a156 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -13,6 +13,10 @@ target_include_directories(compatibility.base PUBLIC $ ) +target_compile_definitions(compatibility.base PRIVATE + CCR_BINARY_DIR="${CMAKE_BINARY_DIR}" +) + function(add_compatibility_kit name) set(libname compatibility.${name}.test) add_executable(${libname}) From 81c758bc0320eda1fb02cdfc1f257d00624b8dce Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 23 Jul 2026 10:12:39 +0000 Subject: [PATCH 19/31] use absolute paths for attachments --- CMakePresets.json | 3 +-- compatibility/CMakeLists.txt | 2 +- compatibility/attachments/attachments.cpp | 4 ++-- .../examples-tables-attachment.cpp | 6 +++--- compatibility/hooks-attachment/hooks-attachment.cpp | 6 +++--- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 277adfed..4e9f5dca 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -190,8 +190,7 @@ "name": "defaults", "hidden": true, "output": { - "outputOnFailure": true, - "verbosity": "verbose" + "outputOnFailure": true }, "execution": { "noTestsAction": "error", diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index 12e6a156..a95e8503 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -38,7 +38,6 @@ function(add_compatibility_kit name) TestCompatibility.cpp ) - if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${name}/${name}.cpp) target_sources(${libname} PRIVATE ${name}/${name}.cpp @@ -56,6 +55,7 @@ function(add_compatibility_kit name) KIT_NDJSON_FILE="${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.ndjson" $<$:SKIP_TEST> CCR_BINARY_DIR="${CMAKE_BINARY_DIR}" + CCR_COMPATIBILITY_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) endfunction() diff --git a/compatibility/attachments/attachments.cpp b/compatibility/attachments/attachments.cpp index 08952d2b..eb23409d 100644 --- a/compatibility/attachments/attachments.cpp +++ b/compatibility/attachments/attachments.cpp @@ -10,7 +10,7 @@ namespace { - const std::filesystem::path currentCompileDir = std::filesystem::path{ std::source_location::current().file_name() }.parent_path(); + const std::filesystem::path compatibilityPath = std::filesystem::path{ KIT_FOLDER }; } WHEN(R"(the string {string} is attached as {string})", (const std::string& text, const std::string& mediaType)) @@ -43,7 +43,7 @@ WHEN(R"(an array with {int} bytes is attached as {string})", (std::int32_t size, WHEN(R"(a PDF document is attached and renamed)") { - std::ifstream pdfFile{ currentCompileDir / "document.pdf", std::ios::binary }; + std::ifstream pdfFile{ compatibilityPath / "document.pdf", std::ios::binary }; Attach(pdfFile, cucumber_cpp::AttachOptions{ .mediaType = "application/pdf", .fileName = "renamed.pdf" }); } diff --git a/compatibility/examples-tables-attachment/examples-tables-attachment.cpp b/compatibility/examples-tables-attachment/examples-tables-attachment.cpp index 6dd3df37..155f9301 100644 --- a/compatibility/examples-tables-attachment/examples-tables-attachment.cpp +++ b/compatibility/examples-tables-attachment/examples-tables-attachment.cpp @@ -8,17 +8,17 @@ namespace { - const std::filesystem::path currentCompileDir = std::filesystem::path{ std::source_location::current().file_name() }.parent_path(); + const std::filesystem::path compatibilityPath = std::filesystem::path{ KIT_FOLDER }; } WHEN(R"(a JPEG image is attached)") { - std::ifstream jpegFile{ currentCompileDir / "cucumber.jpeg", std::ios::binary }; + std::ifstream jpegFile{ compatibilityPath / "cucumber.jpeg", std::ios::binary }; Attach(jpegFile, "image/jpeg"); } WHEN(R"(a PNG image is attached)") { - std::ifstream pngFile{ currentCompileDir / "cucumber.png", std::ios::binary }; + std::ifstream pngFile{ compatibilityPath / "cucumber.png", std::ios::binary }; Attach(pngFile, "image/png"); } diff --git a/compatibility/hooks-attachment/hooks-attachment.cpp b/compatibility/hooks-attachment/hooks-attachment.cpp index ee05a003..6731236a 100644 --- a/compatibility/hooks-attachment/hooks-attachment.cpp +++ b/compatibility/hooks-attachment/hooks-attachment.cpp @@ -7,12 +7,12 @@ namespace { - const std::filesystem::path currentCompileDir = std::filesystem::path{ std::source_location::current().file_name() }.parent_path(); + const std::filesystem::path compatibilityPath = std::filesystem::path{ KIT_FOLDER }; } HOOK_BEFORE_SCENARIO() { - std::ifstream svgFile{ currentCompileDir / "cucumber.svg", std::ios::binary }; + std::ifstream svgFile{ compatibilityPath / "cucumber.svg", std::ios::binary }; Attach(svgFile, "image/svg+xml"); } @@ -23,6 +23,6 @@ WHEN(R"(a step passes)") HOOK_AFTER_SCENARIO() { - std::ifstream svgFile{ currentCompileDir / "cucumber.svg", std::ios::binary }; + std::ifstream svgFile{ compatibilityPath / "cucumber.svg", std::ios::binary }; Attach(svgFile, "image/svg+xml"); } From adf089a240d77babcf3897e8ea8dfe6e24fa6be4 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 23 Jul 2026 13:00:49 +0000 Subject: [PATCH 20/31] resolve robot comments --- .devcontainer/devcontainer.json | 2 +- .github/workflows/ci.yml | 4 +- CMakeLists.txt | 2 - cmake/dependencies.cpm.cmake | 57 +++++++++++++++---- cmake/package-lock.cmake | 7 +-- compatibility/BaseCompatibility.cpp | 4 +- compatibility/CMakeLists.txt | 1 - .../support/DefinitionRegistration.cpp | 2 - .../support/DefinitionRegistration.hpp | 2 - cucumber_cpp/library/support/StepRegistry.cpp | 5 -- cucumber_cpp/library/support/StepRegistry.hpp | 2 - 11 files changed, 51 insertions(+), 37 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9d67bcd8..d660c3b4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -15,6 +15,6 @@ } }, "remoteEnv": { - "CPM_SOURCE_CACHE": "~/cache/.cpm" + "CPM_SOURCE_CACHE": "/root/cache/.cpm" } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 362b1e62..8a544a94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache if: "!startsWith(matrix.target, 'Windows')" @@ -132,7 +132,7 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake') }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 19651e53..cbd60866 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,6 @@ option(CCR_USE_RE2 "Use the RE2 regex engine (fetched when CCR_FETCH_DEPS is set option(CCR_ENABLE_COVERAGE "Enable compiler flags for code coverage measurements" Off) option(CCR_ENABLE_TIME_PROFILE "Enable compiler flags for time profiling measurements" Off) -set(CUCUMBER_CPP_FETCH_DEPS ${CCR_FETCH_DEPS}) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (CCR_BUILD_TESTS) diff --git a/cmake/dependencies.cpm.cmake b/cmake/dependencies.cpm.cmake index 1d3af179..07f31d5f 100644 --- a/cmake/dependencies.cpm.cmake +++ b/cmake/dependencies.cpm.cmake @@ -5,23 +5,28 @@ macro(ccr_dependency PREFIX TAG DIGEST) endmacro() # renovate: datasource=github-tags packageName=cpm-cmake/CPM.cmake versioning=semver -ccr_dependency(CPM_DOWNLOAD v0.43.1 456cb6754daaa010d57444d0c8ce6d95ecf006ab) +ccr_dependency(CPM_DOWNLOAD v0.43.1 456cb6754daaa010d57444d0c8ce6d95ecf006ab) +set(CPM_DOWNLOAD_SHA256 "1c40fc102ce9625d7de7eb14f541cab30cc3138dca627f0b0ec40293ce6c2934") +# renovate: datasource=github-tags packageName=nlohmann/json versioning=semver +ccr_dependency(NLOHMANN_JSON v3.12.0 55f93686c01528224f448c19128836e7df245f72) +# renovate: datasource=github-tags packageName=cucumber/messages versioning=semver +ccr_dependency(CUCUMBER_MESSAGES v34.2.0 073f951ce615149a1532185fbae013ad908a918e) # renovate: datasource=github-tags packageName=cucumber/gherkin versioning=semver -ccr_dependency(CUCUMBER_GHERKIN v42.0.0 f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8) +ccr_dependency(CUCUMBER_GHERKIN v42.0.0 f2f7b51ae6a886aefc1f4a2059e4989b83aab8c8) # renovate: datasource=github-tags packageName=google/googletest versioning=semver -ccr_dependency(GOOGLE_TEST v1.17.0 52eb8108c5bdec04579160ae17225d66034bd723) +ccr_dependency(GOOGLE_TEST v1.17.0 52eb8108c5bdec04579160ae17225d66034bd723) # renovate: datasource=github-tags packageName=CLIUtils/CLI11 versioning=semver -ccr_dependency(CLI11 v2.6.2 37bb6edc5317e99af72ef48405e65d9ca5218861) +ccr_dependency(CLI11 v2.6.2 37bb6edc5317e99af72ef48405e65d9ca5218861) # renovate: datasource=github-tags packageName=fmtlib/fmt versioning=semver -ccr_dependency(LIBFMT v12.1.0 407c905e45ad75fc29bf0f9bb7c5c2fd3475976f) +ccr_dependency(LIBFMT v12.1.0 407c905e45ad75fc29bf0f9bb7c5c2fd3475976f) # renovate: datasource=github-tags packageName=zeux/pugixml versioning=semver -ccr_dependency(PUGIXML v1.15 ee86beb30e4973f5feffe3ce63bfa4fbadf72f38) +ccr_dependency(PUGIXML v1.15 ee86beb30e4973f5feffe3ce63bfa4fbadf72f38) # renovate: datasource=github-tags packageName=abseil/abseil-cpp -ccr_dependency(ABSEIL_CPP 20250814.2 0cf0a5c9d12cc3783363ab20f11613e69fd04c9a) +ccr_dependency(ABSEIL_CPP 20250814.2 0cf0a5c9d12cc3783363ab20f11613e69fd04c9a) # renovate: datasource=github-tags packageName=google/re2 -ccr_dependency(RE2 2025-08-12 0f6c07eae69151e606acb3d9232750c3442dff23) +ccr_dependency(RE2 2025-08-12 0f6c07eae69151e606acb3d9232750c3442dff23) # renovate: datasource=github-tags packageName=jbeder/yaml-cpp versioning=semver -ccr_dependency(YAML_CPP v0.9.0 56e3bb550c91fd7005566f19c079cb7a503223cf) +ccr_dependency(YAML_CPP v0.9.0 56e3bb550c91fd7005566f19c079cb7a503223cf) if(CCR_FETCH_DEPS) if(NOT COMMAND CPMAddPackage) @@ -37,11 +42,18 @@ if(CCR_FETCH_DEPS) "https://github.com/cpm-cmake/CPM.cmake/releases/download/${CPM_DOWNLOAD_TAG}/CPM.cmake" "${CPM_DOWNLOAD_LOCATION}" TLS_VERIFY ON + EXPECTED_HASH SHA256=${CPM_DOWNLOAD_SHA256} + STATUS CPM_DOWNLOAD_STATUS ) + list(GET CPM_DOWNLOAD_STATUS 0 CPM_DOWNLOAD_STATUS_code) + if(NOT CPM_DOWNLOAD_STATUS_code EQUAL 0) + message(FATAL_ERROR "Failed to download CPM.cmake: ${CPM_DOWNLOAD_STATUS}") + endif() endif() include("${CPM_DOWNLOAD_LOCATION}") endif() + CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake) # --------------------------------------------------------------------------- @@ -50,6 +62,26 @@ if(CCR_FETCH_DEPS) # # --------------------------------------------------------------------------- + # --------------------------------------------------------------------------- + # nlohmann_json + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:nlohmann/json@${NLOHMANN_JSON_VERSION}#${NLOHMANN_JSON_DIGEST}" + NAME nlohmann_json + OPTIONS + "JSON_BuildTests Off" + "JSON_Install ON" + ) + + # --------------------------------------------------------------------------- + # cucumber_messages + # --------------------------------------------------------------------------- + CPMAddPackage( + URI "gh:cucumber/messages@${CUCUMBER_MESSAGES_VERSION}#${CUCUMBER_MESSAGES_DIGEST}" + NAME cucumber_messages + SOURCE_SUBDIR cpp + ) + # --------------------------------------------------------------------------- # cucumber_gherkin # --------------------------------------------------------------------------- @@ -57,8 +89,6 @@ if(CCR_FETCH_DEPS) URI "gh:cucumber/gherkin@${CUCUMBER_GHERKIN_VERSION}#${CUCUMBER_GHERKIN_DIGEST}" NAME cucumber_gherkin SOURCE_SUBDIR cpp - OPTIONS - "CUCUMBER_GHERKIN_FETCH_DEPS ON" ) # --------------------------------------------------------------------------- @@ -130,11 +160,14 @@ if(CCR_FETCH_DEPS) CPMAddPackage( URI "gh:jbeder/yaml-cpp@${YAML_CPP_VERSION}#${YAML_CPP_DIGEST}" NAME yaml-cpp - OPTION + OPTIONS "YAML_ENABLE_PIC OFF" ) endif() else() + find_package(CLI11 ${CLI11_VERSION} REQUIRED) + find_package(nlohmann_json ${NLOHMANN_JSON_VERSION} REQUIRED) + find_package(cucumber_messages ${CUCUMBER_MESSAGES_VERSION} REQUIRED) find_package(cucumber_gherkin ${CUCUMBER_GHERKIN_VERSION} REQUIRED) find_package(GTest ${GOOGLE_TEST_VERSION} REQUIRED) find_package(pugixml ${PUGIXML_VERSION} REQUIRED) diff --git a/cmake/package-lock.cmake b/cmake/package-lock.cmake index b17be791..742ce9cd 100644 --- a/cmake/package-lock.cmake +++ b/cmake/package-lock.cmake @@ -22,8 +22,6 @@ CPMDeclarePackage(cucumber_messages SYSTEM YES EXCLUDE_FROM_ALL YES SOURCE_SUBDIR cpp - OPTIONS - "CUCUMBER_MESSAGES_FETCH_DEPS ON" ) # cucumber_gherkin CPMDeclarePackage(cucumber_gherkin @@ -34,8 +32,6 @@ CPMDeclarePackage(cucumber_gherkin SYSTEM YES EXCLUDE_FROM_ALL YES SOURCE_SUBDIR cpp - OPTIONS - "CUCUMBER_GHERKIN_FETCH_DEPS ON" ) # googletest CPMDeclarePackage(googletest @@ -106,5 +102,6 @@ CPMDeclarePackage(yaml-cpp GITHUB_REPOSITORY jbeder/yaml-cpp SYSTEM YES EXCLUDE_FROM_ALL YES - OPTION YAML_ENABLE_PIC OFF + OPTIONS + "YAML_ENABLE_PIC OFF" ) diff --git a/compatibility/BaseCompatibility.cpp b/compatibility/BaseCompatibility.cpp index 7cb130c3..fb1da6e8 100644 --- a/compatibility/BaseCompatibility.cpp +++ b/compatibility/BaseCompatibility.cpp @@ -4,7 +4,7 @@ #include "cucumber_cpp/library/api/Formatters.hpp" #include "cucumber_cpp/library/api/RunCucumber.hpp" #include "cucumber_cpp/library/cucumber_expression/ParameterRegistry.hpp" -#include "cucumber_cpp/library/support/SupportCodeLibrary.hpp" +#include "cucumber_cpp/library/support/DefinitionRegistration.hpp" #include "cucumber_cpp/library/support/Types.hpp" #include "cucumber_cpp/library/tag_expression/Parser.hpp" #include "cucumber_cpp/library/util/Broadcaster.hpp" @@ -14,8 +14,6 @@ #include "nlohmann/json_fwd.hpp" #include #include -#include -#include #include #include #include diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index a95e8503..05d9f92d 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -54,7 +54,6 @@ function(add_compatibility_kit name) KIT_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}/${name}" KIT_NDJSON_FILE="${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.ndjson" $<$:SKIP_TEST> - CCR_BINARY_DIR="${CMAKE_BINARY_DIR}" CCR_COMPATIBILITY_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) endfunction() diff --git a/cucumber_cpp/library/support/DefinitionRegistration.cpp b/cucumber_cpp/library/support/DefinitionRegistration.cpp index 4ff3c549..f331c71b 100644 --- a/cucumber_cpp/library/support/DefinitionRegistration.cpp +++ b/cucumber_cpp/library/support/DefinitionRegistration.cpp @@ -8,7 +8,6 @@ #include "cucumber_cpp/library/util/HookFactory.hpp" #include "cucumber_cpp/library/util/StepFactory.hpp" #include -#include #include #include #include @@ -76,7 +75,6 @@ namespace cucumber_cpp::library::support std::size_t DefinitionRegistration::Register(std::string_view matcher, StepType stepType, util::StepFactory factory, std::source_location sourceLocation) { - fmt::println("DefinitionRegistration::Register: {}", sourceLocation.file_name()); registry.try_emplace(sourceLocation, StepStringRegistration::Entry{ stepType, std::string{ matcher }, factory, sourceLocation }); return registry.size(); } diff --git a/cucumber_cpp/library/support/DefinitionRegistration.hpp b/cucumber_cpp/library/support/DefinitionRegistration.hpp index 80c14104..6f1b9a33 100644 --- a/cucumber_cpp/library/support/DefinitionRegistration.hpp +++ b/cucumber_cpp/library/support/DefinitionRegistration.hpp @@ -10,7 +10,6 @@ #include "cucumber_cpp/library/util/HookFactory.hpp" #include "cucumber_cpp/library/util/StepFactory.hpp" #include -#include #include #include #include @@ -97,7 +96,6 @@ namespace cucumber_cpp::library::support template std::size_t DefinitionRegistration::Register(std::string_view matcher, StepType stepType, std::source_location sourceLocation) { - fmt::println("DefinitionRegistration::Register: {}", sourceLocation.file_name()); return Instance().Register(matcher, stepType, util::StepBodyFactory, sourceLocation); } diff --git a/cucumber_cpp/library/support/StepRegistry.cpp b/cucumber_cpp/library/support/StepRegistry.cpp index 8fb1fb9a..bbfcd9e5 100644 --- a/cucumber_cpp/library/support/StepRegistry.cpp +++ b/cucumber_cpp/library/support/StepRegistry.cpp @@ -1,6 +1,5 @@ #include "cucumber_cpp/library/support/StepRegistry.hpp" #include "cucumber/gherkin/id_generator.hpp" -#include "cucumber/messages/step_definition_pattern_type.hpp" #include "cucumber_cpp/library/cucumber_expression/Argument.hpp" #include "cucumber_cpp/library/cucumber_expression/Errors.hpp" #include "cucumber_cpp/library/cucumber_expression/Expression.hpp" @@ -13,12 +12,10 @@ #include "cucumber_cpp/library/support/UndefinedParameters.hpp" #include "cucumber_cpp/library/util/StepFactory.hpp" #include -#include #include #include #include #include -#include #include #include #include @@ -101,8 +98,6 @@ namespace cucumber_cpp::library::support ? ExpressionPatternType::regularExpression : ExpressionPatternType::cucumberExpression; - fmt::println("Registering step definition@{}", sourceLocation.file_name()); - registry.emplace_back(factory, id, sourceLocation.line(), diff --git a/cucumber_cpp/library/support/StepRegistry.hpp b/cucumber_cpp/library/support/StepRegistry.hpp index 6011f847..edfb4b94 100644 --- a/cucumber_cpp/library/support/StepRegistry.hpp +++ b/cucumber_cpp/library/support/StepRegistry.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -138,7 +137,6 @@ namespace cucumber_cpp::library::support , factory{ factory } , sourceLocation{ sourceLocation } { - fmt::println("StepStringRegistration::Entry: {}", sourceLocation.file_name()); } StepType type{}; From 2743412cc057b9672efbd38c41af69b3b186ff07 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 23 Jul 2026 13:18:43 +0000 Subject: [PATCH 21/31] don't use cache (cpm/ccache) for release builds --- .github/workflows/ci.yml | 16 +++++++++++----- .github/workflows/static-analysis.yml | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a544a94..d557d081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,13 +54,14 @@ jobs: key: cache-winsdk-10.0.26100-14.43.17.13 - name: Cache CPM packages + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache - if: "!startsWith(matrix.target, 'Windows')" + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CCACHE_DIR }} @@ -87,13 +88,14 @@ jobs: persist-credentials: false - name: Cache CPM packages + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache - if: "!startsWith(matrix.target, 'Windows')" + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CCACHE_DIR }} @@ -129,15 +131,19 @@ jobs: persist-credentials: false - name: Cache CPM packages + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + - name: Cache ccache + if: ${{ !startsWith(github.ref, 'refs/tags/') && !startsWith(matrix.os, 'windows') }} + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: - key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.type }}${{ matrix.preset_suffix }} - max-size: 2G + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} + restore-keys: ccache-${{ github.job }}-${{ matrix.os }}- - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9e9b2976..999847d8 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -33,12 +33,14 @@ jobs: persist-credentials: false - name: Cache CPM packages + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CCACHE_DIR }} @@ -88,12 +90,14 @@ jobs: persist-credentials: false - name: Cache CPM packages + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Cache ccache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CCACHE_DIR }} From 184d00857cc59e15b4a1f1dc9931c1e78c6388b1 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 23 Jul 2026 14:02:29 +0000 Subject: [PATCH 22/31] ci: update caching strategy for CPM packages and ccache --- .github/workflows/ci.yml | 79 ++++++++++++++++++--------- .github/workflows/static-analysis.yml | 44 +++++++++------ cmake/dependencies.cpm.cmake | 10 ++-- compatibility/CMakeLists.txt | 1 - 4 files changed, 84 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d557d081..1cc63a03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,26 +53,31 @@ jobs: path: /winsdk key: cache-winsdk-10.0.26100-14.43.17.13 - - name: Cache CPM packages - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - name: Cache ccache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + if: ${{ !startsWith(matrix.target, 'Windows') }} with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ github.job }}-${{ matrix.target }}-${{ github.ref }} - restore-keys: ccache-${{ github.job }}-${{ matrix.target }}- + key: ${{ github.job }}-${{ matrix.target }} + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "${{ matrix.target}}" buildPreset: "${{ matrix.target}}-Release" + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + test-linux: name: Acceptance Test on Linux runs-on: [ubuntu-latest] @@ -87,26 +92,30 @@ jobs: with: persist-credentials: false - - name: Cache CPM packages - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - name: Cache ccache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ github.job }}-${{ github.ref }} - restore-keys: ccache-${{ github.job }}- + key: ccache-${{ github.job }}- + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "Host" buildPreset: "Host-Debug" + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + - run: | bats --formatter junit cucumber_cpp/acceptance_test/test.bats | tee test-report.xml @@ -130,25 +139,41 @@ jobs: with: persist-credentials: false - - name: Cache CPM packages - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Install build tools (ubuntu) + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install -y ccache + + - name: Install build tools (macos) + if: startsWith(matrix.os, 'macos') + run: brew install ccache + + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - name: Cache ccache - if: ${{ !startsWith(github.ref, 'refs/tags/') && !startsWith(matrix.os, 'windows') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + if: ${{ !startsWith(matrix.os, 'windows') }} with: - path: ${{ env.CCACHE_DIR }} key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} restore-keys: ccache-${{ github.job }}-${{ matrix.os }}- + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: workflowPreset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + - name: Upload test logs if: ${{ failure() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 999847d8..3ae7bfc5 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -32,20 +32,17 @@ jobs: fetch-depth: 0 # Disable shallow clone to enable blame information persist-credentials: false - - name: Cache CPM packages - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - name: Cache ccache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ github.job }}-${{ github.ref }} - restore-keys: ccache-${{ github.job }}- + key: ccache-${{ github.job }}- + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Build for coverage uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 @@ -56,6 +53,13 @@ jobs: env: GTEST_OUTPUT: "xml:${{ github.workspace }}/testresults/" + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + - name: Run acceptance tests run: | bats --formatter junit cucumber_cpp/acceptance_test/test.bats | tee test-report.xml @@ -89,20 +93,17 @@ jobs: with: persist-credentials: false - - name: Cache CPM packages - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.CPM_SOURCE_CACHE }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - name: Cache ccache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ github.job }}-${{ github.ref }} - restore-keys: ccache-${{ github.job }}- + key: ccache-${{ github.job }}- + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 with: @@ -113,4 +114,11 @@ jobs: configurePreset: "Host" buildPreset: "Host-Debug" + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.CPM_SOURCE_CACHE }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + - uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 diff --git a/cmake/dependencies.cpm.cmake b/cmake/dependencies.cpm.cmake index 07f31d5f..6972aa8c 100644 --- a/cmake/dependencies.cpm.cmake +++ b/cmake/dependencies.cpm.cmake @@ -54,7 +54,7 @@ if(CCR_FETCH_DEPS) include("${CPM_DOWNLOAD_LOCATION}") endif() - CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake) + CPMUsePackageLock("${CMAKE_CURRENT_LIST_DIR}/package-lock.cmake") # --------------------------------------------------------------------------- # @@ -102,9 +102,11 @@ if(CCR_FETCH_DEPS) "gtest_force_shared_crt ON" ) - set_target_properties(gtest gtest_main gmock gmock_main PROPERTIES - FOLDER External/GoogleTest - ) + if (TARGET gtest) + set_target_properties(gtest gtest_main gmock gmock_main PROPERTIES + FOLDER External/GoogleTest + ) + endif() # --------------------------------------------------------------------------- # cli11 diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index 05d9f92d..09cb54cf 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -54,7 +54,6 @@ function(add_compatibility_kit name) KIT_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}/${name}" KIT_NDJSON_FILE="${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.ndjson" $<$:SKIP_TEST> - CCR_COMPATIBILITY_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) endfunction() From 015731cd7e76c07b1d11ab67437fb257fffa0534 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 23 Jul 2026 14:57:08 +0000 Subject: [PATCH 23/31] use re-usable actions for building --- .github/actions/build-test/action.yml | 53 +++++++++++++++++++++++++ .github/actions/build/action.yml | 49 +++++++++++++++++++++++ .github/actions/workflow/action.yml | 45 +++++++++++++++++++++ .github/workflows/ci.yml | 56 +++++++++++++++------------ 4 files changed, 179 insertions(+), 24 deletions(-) create mode 100644 .github/actions/build-test/action.yml create mode 100644 .github/actions/build/action.yml create mode 100644 .github/actions/workflow/action.yml diff --git a/.github/actions/build-test/action.yml b/.github/actions/build-test/action.yml new file mode 100644 index 00000000..ae22cc9a --- /dev/null +++ b/.github/actions/build-test/action.yml @@ -0,0 +1,53 @@ +--- +name: Build and Test +description: Builds and tests the project using CMake + +inputs: + cpm-source-cache: + description: Path to the CPM source cache directory + required: true + use-ccache: + description: Use ccache to speed up builds + required: false + default: true + ccache-key: + description: Key for ccache cache + required: false + configure-preset: + description: CMake configure preset to use + required: true + build-preset: + description: CMake build preset to use + required: true + test-preset: + description: CMake test preset to use + required: true + +runs: + using: composite + steps: + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ inputs.cpm-source-cache }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + if: ${{ inputs.use-ccache == 'true' }} + with: + key: ${{ inputs.ccache-key }} + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} + + - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 + with: + configurePreset: "${{ inputs.configure-preset }}" + buildPreset: "${{ inputs.build-preset }}" + testPreset: "${{ inputs.test-preset }}" + + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ inputs.cpm-source-cache }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 00000000..09cec0ff --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,49 @@ +--- +name: Build +description: Builds the project using CMake + +inputs: + cpm-source-cache: + description: Path to the CPM source cache directory + required: true + use-ccache: + description: Use ccache to speed up builds + required: false + default: true + ccache-key: + description: Key for ccache cache + required: false + configure-preset: + description: CMake configure preset to use + required: true + build-preset: + description: CMake build preset to use + required: true + +runs: + using: composite + steps: + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ inputs.cpm-source-cache }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + if: ${{ inputs.use-ccache == 'true' }} + with: + key: ${{ inputs.ccache-key }} + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} + + - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 + with: + configurePreset: "${{ inputs.configure-preset }}" + buildPreset: "${{ inputs.build-preset }}" + + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ inputs.cpm-source-cache }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} diff --git a/.github/actions/workflow/action.yml b/.github/actions/workflow/action.yml new file mode 100644 index 00000000..fd3247f1 --- /dev/null +++ b/.github/actions/workflow/action.yml @@ -0,0 +1,45 @@ +--- +name: Workflow Action +description: Uses a workflow preset for CMake + +inputs: + cpm-source-cache: + description: Path to the CPM source cache directory + required: true + use-ccache: + description: Use ccache to speed up builds + required: false + default: true + ccache-key: + description: Key for ccache cache + required: false + workflow-preset: + description: CMake workflow preset to use + required: true + +runs: + using: composite + steps: + - name: Restore CPM packages cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ inputs.cpm-source-cache }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + + - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + if: ${{ inputs.use-ccache == 'true' }} + with: + key: ${{ inputs.ccache-key }} + max-size: 2G + save: ${{ !startsWith(github.ref, 'refs/tags/') }} + + - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 + with: + workflowPreset: "${{ inputs.workflow-preset }}" + + - name: Save CPM packages cache + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ inputs.cpm-source-cache }} + key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cc63a03..4996e8f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,30 +149,38 @@ jobs: if: startsWith(matrix.os, 'macos') run: brew install ccache - - name: Restore CPM packages cache - uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 - if: ${{ !startsWith(matrix.os, 'windows') }} - with: - key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} - restore-keys: ccache-${{ github.job }}-${{ matrix.os }}- - max-size: 2G - save: ${{ !startsWith(github.ref, 'refs/tags/') }} - - - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 - with: - workflowPreset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" - - - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + - name: use location action + uses: ./.github/actions/workflow + with: + cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} + use-ccache: ${{ !startsWith(matrix.os, 'windows') }} + ccache-key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} + workflow-preset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" + + # - name: Restore CPM packages cache + # uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + # with: + # path: ${{ env.CPM_SOURCE_CACHE }} + # key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + + # - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + # if: ${{ !startsWith(matrix.os, 'windows') }} + # with: + # key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} + # restore-keys: ccache-${{ github.job }}-${{ matrix.os }}- + # max-size: 2G + # save: ${{ !startsWith(github.ref, 'refs/tags/') }} + + # - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 + # with: + # workflowPreset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" + + # - name: Save CPM packages cache + # if: ${{ !startsWith(github.ref, 'refs/tags/') }} + # uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + # with: + # path: ${{ env.CPM_SOURCE_CACHE }} + # key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - name: Upload test logs if: ${{ failure() }} From cef67262bcfddaae09009a5f63627a80facb0a09 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 23 Jul 2026 15:45:39 +0000 Subject: [PATCH 24/31] dont save cpm cache when restored --- .github/actions/build-test/action.yml | 3 ++- .github/actions/build/action.yml | 3 ++- .github/actions/workflow/action.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-test/action.yml b/.github/actions/build-test/action.yml index ae22cc9a..9b634d3e 100644 --- a/.github/actions/build-test/action.yml +++ b/.github/actions/build-test/action.yml @@ -28,6 +28,7 @@ runs: steps: - name: Restore CPM packages cache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + id: cache-cpm with: path: ${{ inputs.cpm-source-cache }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} @@ -46,7 +47,7 @@ runs: testPreset: "${{ inputs.test-preset }}" - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} + if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.cache-cpm.outputs.cache-hit != 'true' }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ inputs.cpm-source-cache }} diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 09cec0ff..840937e1 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -25,6 +25,7 @@ runs: steps: - name: Restore CPM packages cache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + id: cache-cpm with: path: ${{ inputs.cpm-source-cache }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} @@ -42,7 +43,7 @@ runs: buildPreset: "${{ inputs.build-preset }}" - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} + if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.cache-cpm.outputs.cache-hit != 'true' }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ inputs.cpm-source-cache }} diff --git a/.github/actions/workflow/action.yml b/.github/actions/workflow/action.yml index fd3247f1..99cac0ac 100644 --- a/.github/actions/workflow/action.yml +++ b/.github/actions/workflow/action.yml @@ -22,6 +22,7 @@ runs: steps: - name: Restore CPM packages cache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + id: cache-cpm with: path: ${{ inputs.cpm-source-cache }} key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} @@ -38,7 +39,7 @@ runs: workflowPreset: "${{ inputs.workflow-preset }}" - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} + if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.cache-cpm.outputs.cache-hit != 'true' }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ inputs.cpm-source-cache }} From 345a7e292ccee553dc1da48d1c401d0395c5c665 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 23 Jul 2026 15:46:07 +0000 Subject: [PATCH 25/31] use resuable buildflow --- .github/workflows/ci.yml | 66 +++++----------------------------------- 1 file changed, 8 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4996e8f0..b53961b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,29 +92,14 @@ jobs: with: persist-credentials: false - - name: Restore CPM packages cache - uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 - with: - key: ccache-${{ github.job }}- - max-size: 2G - save: ${{ !startsWith(github.ref, 'refs/tags/') }} - - - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 + - name: Build + uses: ./.github/actions/build with: - configurePreset: "Host" - buildPreset: "Host-Debug" - - - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} + use-ccache: ${{ !startsWith(matrix.os, 'windows') }} + ccache-key: ${{ github.job }}-${{ github.ref }} + configure-preset: "Host" + build-preset: "Host-Debug" - run: | bats --formatter junit cucumber_cpp/acceptance_test/test.bats | tee test-report.xml @@ -139,17 +124,7 @@ jobs: with: persist-credentials: false - - name: Install build tools (ubuntu) - if: startsWith(matrix.os, 'ubuntu') - run: | - sudo apt-get update - sudo apt-get install -y ccache - - - name: Install build tools (macos) - if: startsWith(matrix.os, 'macos') - run: brew install ccache - - - name: use location action + - name: Build and test uses: ./.github/actions/workflow with: cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} @@ -157,31 +132,6 @@ jobs: ccache-key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} workflow-preset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" - # - name: Restore CPM packages cache - # uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - # with: - # path: ${{ env.CPM_SOURCE_CACHE }} - # key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - # - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 - # if: ${{ !startsWith(matrix.os, 'windows') }} - # with: - # key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} - # restore-keys: ccache-${{ github.job }}-${{ matrix.os }}- - # max-size: 2G - # save: ${{ !startsWith(github.ref, 'refs/tags/') }} - - # - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 - # with: - # workflowPreset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" - - # - name: Save CPM packages cache - # if: ${{ !startsWith(github.ref, 'refs/tags/') }} - # uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - # with: - # path: ${{ env.CPM_SOURCE_CACHE }} - # key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - name: Upload test logs if: ${{ failure() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From c06c774318a1eefb4b34efa88ddd33ce7f125e19 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Fri, 24 Jul 2026 08:06:48 +0000 Subject: [PATCH 26/31] resolve robot comments --- .github/workflows/ci.yml | 32 ++++---------- .github/workflows/static-analysis.yml | 61 +++++++-------------------- cmake/dependencies.cpm.cmake | 4 +- 3 files changed, 25 insertions(+), 72 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b53961b4..acf3b0fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,30 +53,14 @@ jobs: path: /winsdk key: cache-winsdk-10.0.26100-14.43.17.13 - - name: Restore CPM packages cache - uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 - if: ${{ !startsWith(matrix.target, 'Windows') }} - with: - key: ${{ github.job }}-${{ matrix.target }} - max-size: 2G - save: ${{ !startsWith(github.ref, 'refs/tags/') }} - - - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 - with: - configurePreset: "${{ matrix.target}}" - buildPreset: "${{ matrix.target}}-Release" - - - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Build + uses: ./.github/actions/build with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} + use-ccache: ${{ !startsWith(matrix.target, 'Windows') }} + ccache-key: ${{ github.job }}-${{ github.ref }}-${{ matrix.target }} + configure-preset: "${{ matrix.target}}" + build-preset: "${{ matrix.target}}-Release" test-linux: name: Acceptance Test on Linux @@ -96,7 +80,7 @@ jobs: uses: ./.github/actions/build with: cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} - use-ccache: ${{ !startsWith(matrix.os, 'windows') }} + use-ccache: true ccache-key: ${{ github.job }}-${{ github.ref }} configure-preset: "Host" build-preset: "Host-Debug" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 3ae7bfc5..b3594fe6 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -32,34 +32,18 @@ jobs: fetch-depth: 0 # Disable shallow clone to enable blame information persist-credentials: false - - name: Restore CPM packages cache - uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Build + uses: ./.github/actions/build-test with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 - with: - key: ccache-${{ github.job }}- - max-size: 2G - save: ${{ !startsWith(github.ref, 'refs/tags/') }} - - - name: Build for coverage - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 - with: - configurePreset: "Coverage" - buildPreset: "Coverage" - testPreset: "Coverage" + cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} + use-ccache: true + ccache-key: ${{ github.job }}-${{ github.ref }} + configure-preset: "Coverage" + build-preset: "Coverage" + test-preset: "Coverage" env: GTEST_OUTPUT: "xml:${{ github.workspace }}/testresults/" - - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - name: Run acceptance tests run: | bats --formatter junit cucumber_cpp/acceptance_test/test.bats | tee test-report.xml @@ -93,32 +77,17 @@ jobs: with: persist-credentials: false - - name: Restore CPM packages cache - uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} - - - uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 - with: - key: ccache-${{ github.job }}- - max-size: 2G - save: ${{ !startsWith(github.ref, 'refs/tags/') }} - - uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 with: languages: cpp - - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 - with: - configurePreset: "Host" - buildPreset: "Host-Debug" - - - name: Save CPM packages cache - if: ${{ !startsWith(github.ref, 'refs/tags/') }} - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + - name: Build + uses: ./.github/actions/build with: - path: ${{ env.CPM_SOURCE_CACHE }} - key: cpm-${{ hashFiles('cmake/dependencies.cpm.cmake', 'cmake/package-lock.cmake') }} + cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} + use-ccache: true + ccache-key: ${{ github.job }}-${{ github.ref }} + configure-preset: "Host" + build-preset: "Host-Debug" - uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 diff --git a/cmake/dependencies.cpm.cmake b/cmake/dependencies.cpm.cmake index 6972aa8c..fc6369fa 100644 --- a/cmake/dependencies.cpm.cmake +++ b/cmake/dependencies.cpm.cmake @@ -31,7 +31,7 @@ ccr_dependency(YAML_CPP v0.9.0 56e3bb550c91fd7005566f19c079cb7a5032 if(CCR_FETCH_DEPS) if(NOT COMMAND CPMAddPackage) # --------------------------------------------------------------------------- - # CPM – download on first configure if not already cached (standalone only) + # CPM – download on first configure if not already cached # --------------------------------------------------------------------------- set(CPM_USE_LOCAL_PACKAGES ON) set(CPM_DOWNLOAD_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") @@ -171,7 +171,7 @@ else() find_package(nlohmann_json ${NLOHMANN_JSON_VERSION} REQUIRED) find_package(cucumber_messages ${CUCUMBER_MESSAGES_VERSION} REQUIRED) find_package(cucumber_gherkin ${CUCUMBER_GHERKIN_VERSION} REQUIRED) - find_package(GTest ${GOOGLE_TEST_VERSION} REQUIRED) + find_package(GTest REQUIRED) find_package(pugixml ${PUGIXML_VERSION} REQUIRED) find_package(fmt ${LIBFMT_VERSION} REQUIRED) From dd4817733e449a4698dd0aeff8f5bf7002c335e4 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Fri, 24 Jul 2026 08:34:04 +0000 Subject: [PATCH 27/31] resolve robot comments --- .github/actions/build-test/action.yml | 4 +++- .github/actions/build/action.yml | 5 ++++- .github/actions/workflow/action.yml | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-test/action.yml b/.github/actions/build-test/action.yml index 9b634d3e..a068bbfc 100644 --- a/.github/actions/build-test/action.yml +++ b/.github/actions/build-test/action.yml @@ -12,7 +12,7 @@ inputs: default: true ccache-key: description: Key for ccache cache - required: false + required: true configure-preset: description: CMake configure preset to use required: true @@ -45,6 +45,8 @@ runs: configurePreset: "${{ inputs.configure-preset }}" buildPreset: "${{ inputs.build-preset }}" testPreset: "${{ inputs.test-preset }}" + env: + CPM_SOURCE_CACHE: ${{ inputs.cpm-source-cache }} - name: Save CPM packages cache if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.cache-cpm.outputs.cache-hit != 'true' }} diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 840937e1..95d5e68f 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -12,7 +12,7 @@ inputs: default: true ccache-key: description: Key for ccache cache - required: false + required: true configure-preset: description: CMake configure preset to use required: true @@ -36,12 +36,15 @@ runs: key: ${{ inputs.ccache-key }} max-size: 2G save: ${{ !startsWith(github.ref, 'refs/tags/') }} + env: + CPM_SOURCE_CACHE: ${{ inputs.cpm-source-cache }} - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "${{ inputs.configure-preset }}" buildPreset: "${{ inputs.build-preset }}" + - name: Save CPM packages cache if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.cache-cpm.outputs.cache-hit != 'true' }} uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 diff --git a/.github/actions/workflow/action.yml b/.github/actions/workflow/action.yml index 99cac0ac..d4cb853f 100644 --- a/.github/actions/workflow/action.yml +++ b/.github/actions/workflow/action.yml @@ -12,7 +12,7 @@ inputs: default: true ccache-key: description: Key for ccache cache - required: false + required: true workflow-preset: description: CMake workflow preset to use required: true @@ -37,6 +37,8 @@ runs: - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: workflowPreset: "${{ inputs.workflow-preset }}" + env: + CPM_SOURCE_CACHE: ${{ inputs.cpm-source-cache }} - name: Save CPM packages cache if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.cache-cpm.outputs.cache-hit != 'true' }} From 6ee708e63d8d6806268b8cb47f61d7956eb083dd Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Fri, 24 Jul 2026 08:43:50 +0000 Subject: [PATCH 28/31] remove ref from cache-key, remove ccache env variables --- .github/workflows/ci.yml | 10 ++++------ .github/workflows/static-analysis.yml | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acf3b0fa..8c57e787 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,6 @@ concurrency: env: GTEST_COLOR: 1 - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: ${{ github.workspace }}/.ccache CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm jobs: @@ -57,8 +55,8 @@ jobs: uses: ./.github/actions/build with: cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} - use-ccache: ${{ !startsWith(matrix.target, 'Windows') }} - ccache-key: ${{ github.job }}-${{ github.ref }}-${{ matrix.target }} + use-ccache: true + ccache-key: ${{ github.job }}-${{ matrix.target }} configure-preset: "${{ matrix.target}}" build-preset: "${{ matrix.target}}-Release" @@ -81,7 +79,7 @@ jobs: with: cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} use-ccache: true - ccache-key: ${{ github.job }}-${{ github.ref }} + ccache-key: ${{ github.job }} configure-preset: "Host" build-preset: "Host-Debug" @@ -113,7 +111,7 @@ jobs: with: cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} use-ccache: ${{ !startsWith(matrix.os, 'windows') }} - ccache-key: ccache-${{ github.job }}-${{ matrix.os }}-${{ github.ref }}-${{ matrix.type }}${{ matrix.preset_suffix }} + ccache-key: ccache-${{ github.job }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.type }}${{ matrix.preset_suffix }} workflow-preset: "${{ matrix.os }}-Debug-${{ matrix.type }}${{ matrix.preset_suffix }}" - name: Upload test logs diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index b3594fe6..42981b15 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -15,8 +15,7 @@ concurrency: cancel-in-progress: true env: - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: ${{ github.workspace }}/.ccache + GTEST_COLOR: 1 CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm jobs: @@ -37,7 +36,7 @@ jobs: with: cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} use-ccache: true - ccache-key: ${{ github.job }}-${{ github.ref }} + ccache-key: ${{ github.job }} configure-preset: "Coverage" build-preset: "Coverage" test-preset: "Coverage" @@ -86,7 +85,7 @@ jobs: with: cpm-source-cache: ${{ env.CPM_SOURCE_CACHE }} use-ccache: true - ccache-key: ${{ github.job }}-${{ github.ref }} + ccache-key: ${{ github.job }} configure-preset: "Host" build-preset: "Host-Debug" From e5833bc0aba5919b3d6f7b9a6be1aa926f200666 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Fri, 24 Jul 2026 09:12:42 +0000 Subject: [PATCH 29/31] update action inputs: make use-ccache required and ccache-key optional --- .github/actions/build-test/action.yml | 5 ++--- .github/actions/build/action.yml | 5 ++--- .github/actions/workflow/action.yml | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/actions/build-test/action.yml b/.github/actions/build-test/action.yml index a068bbfc..d67b67ab 100644 --- a/.github/actions/build-test/action.yml +++ b/.github/actions/build-test/action.yml @@ -8,11 +8,10 @@ inputs: required: true use-ccache: description: Use ccache to speed up builds - required: false - default: true + required: true ccache-key: description: Key for ccache cache - required: true + required: false configure-preset: description: CMake configure preset to use required: true diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 95d5e68f..b99c9a55 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -8,11 +8,10 @@ inputs: required: true use-ccache: description: Use ccache to speed up builds - required: false - default: true + required: true ccache-key: description: Key for ccache cache - required: true + required: false configure-preset: description: CMake configure preset to use required: true diff --git a/.github/actions/workflow/action.yml b/.github/actions/workflow/action.yml index d4cb853f..e0b486b2 100644 --- a/.github/actions/workflow/action.yml +++ b/.github/actions/workflow/action.yml @@ -8,11 +8,10 @@ inputs: required: true use-ccache: description: Use ccache to speed up builds - required: false - default: true + required: true ccache-key: description: Key for ccache cache - required: true + required: false workflow-preset: description: CMake workflow preset to use required: true From 9c73f6821fe66484e01fec2bc6a59678f62091bd Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Fri, 24 Jul 2026 09:24:42 +0000 Subject: [PATCH 30/31] Don't run CodeQL in a container --- .github/workflows/static-analysis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 42981b15..626ea590 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -68,7 +68,6 @@ jobs: codeql: name: CodeQL runs-on: ubuntu-latest - container: ghcr.io/philips-software/amp-devcontainer-cpp:7.2.0@sha256:1afa82f415104fd36c8af65740872fd01685275c2e1620f8133c35b3fbff0590 permissions: security-events: write steps: From bc0f286360b2c1f1c992e8801e7db4507ac1bcc1 Mon Sep 17 00:00:00 2001 From: Daan Timmer <8293597+daantimmer@users.noreply.github.com> Date: Fri, 24 Jul 2026 11:29:38 +0200 Subject: [PATCH 31/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- compatibility/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compatibility/CMakeLists.txt b/compatibility/CMakeLists.txt index 09cb54cf..b9372459 100644 --- a/compatibility/CMakeLists.txt +++ b/compatibility/CMakeLists.txt @@ -13,8 +13,9 @@ target_include_directories(compatibility.base PUBLIC $ ) +file(TO_CMAKE_PATH "${CMAKE_BINARY_DIR}" CCR_BINARY_DIR_CMAKE) target_compile_definitions(compatibility.base PRIVATE - CCR_BINARY_DIR="${CMAKE_BINARY_DIR}" + CCR_BINARY_DIR="${CCR_BINARY_DIR_CMAKE}" ) function(add_compatibility_kit name)