From 658beb74f8bfe24aa54aa227ea61712bcf2e20a1 Mon Sep 17 00:00:00 2001 From: Edward Nolan Date: Mon, 6 Apr 2026 03:03:51 +0000 Subject: [PATCH] Refresh to latest beman.exemplar template Update all infrastructure files to match the latest exemplar template (stamp). This includes updated infra submodule, workflow versions (@1.3.0 -> @1.5.0), pre-commit hook versions, and CMakePresets. The CI matrix from cstring_view is preserved. C++ source files, docs, and papers are unchanged. Co-Authored-By: Claude Opus 4.6 --- .exemplar_version | 1 + .github/CODEOWNERS | 22 +--------------------- .github/workflows/ci_tests.yml | 10 +++++----- .github/workflows/pre-commit-check.yml | 8 +++++++- .github/workflows/pre-commit-update.yml | 4 ++-- .pre-commit-config.yaml | 2 +- CMakeLists.txt | 2 +- CONTRIBUTING.md | 4 ++-- examples/CMakeLists.txt | 1 - infra/.beman_submodule | 2 +- infra/cmake/beman-install-library.cmake | 10 +++++----- infra/cmake/use-fetch-content.cmake | 12 ++++++++++++ tests/beman/cstring_view/CMakeLists.txt | 2 +- 13 files changed, 39 insertions(+), 41 deletions(-) create mode 100644 .exemplar_version diff --git a/.exemplar_version b/.exemplar_version new file mode 100644 index 0000000..c45b836 --- /dev/null +++ b/.exemplar_version @@ -0,0 +1 @@ +f5759898e1ac110fc070791b83267f13c9b50b4c diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e692804..d9ee737 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,23 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# Codeowners for reviews on PRs -# Note(river): -# **Please understand how codeowner file work before uncommenting anything in this section:** -# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners -# -# For projects using cstring_view as a template and intend to reuse its infrastructure, -# River (@wusatosi) helped create most of the original infrastructure under the scope described below, -# they are more than happy to help out with any PRs downstream, -# as well as to sync any useful change upstream to cstring_view. -# -# Github Actions: -# .github/workflows/ @wusatosi # Add other project owners here -# -# Devcontainer: -# .devcontainer/ @wusatosi # Add other project owners here -# -# Pre-commit: -# .pre-commit-config.yaml @wusatosi # Add other project owners here -# .markdownlint.yaml @wusatosi # Add other project owners here - -* @dascandy @neatudarius +* @dascandy diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index a7d8233..2847eb4 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -9,14 +9,14 @@ on: pull_request: workflow_dispatch: schedule: - - cron: '6 13 * * 5' + - cron: '35 16 * * 1' jobs: beman-submodule-check: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.3.0 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.5.0 preset-test: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.3.0 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.5.0 with: matrix_config: > [ @@ -31,7 +31,7 @@ jobs: ] build-and-test: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.3.0 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.5.0 with: matrix_config: > { @@ -129,4 +129,4 @@ jobs: create-issue-when-fault: needs: [preset-test, build-and-test] if: failure() && github.event_name == 'schedule' - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.3.0 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.5.0 diff --git a/.github/workflows/pre-commit-check.yml b/.github/workflows/pre-commit-check.yml index 2f91103..5d1ca93 100644 --- a/.github/workflows/pre-commit-check.yml +++ b/.github/workflows/pre-commit-check.yml @@ -8,6 +8,12 @@ on: branches: - main +permissions: + contents: read + checks: write + issues: write + pull-requests: write + jobs: pre-commit: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.3.0 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.5.0 diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml index 7fc5ac5..eee5d2e 100644 --- a/.github/workflows/pre-commit-update.yml +++ b/.github/workflows/pre-commit-update.yml @@ -5,11 +5,11 @@ name: Weekly pre-commit autoupdate on: workflow_dispatch: schedule: - - cron: "39 15 * * 6" + - cron: "28 13 * * 1" jobs: auto-update-pre-commit: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.3.0 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.5.0 secrets: APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }} PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da9365a..df49630 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: # This brings in a portable version of clang-format. # See also: https://github.com/ssciwr/clang-format-wheel - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v22.1.1 + rev: v22.1.2 hooks: - id: clang-format types_or: [c++, c] diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fc4c44..593054a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.30...4.3) project( beman.cstring_view # CMake Project Name, which is also the name of the top-level # targets (e.g., library, executable, etc.). - DESCRIPTION "cstring_view, a null-terminated string view" + DESCRIPTION "A null-terminated string view." LANGUAGES CXX VERSION 0.1.0 ) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e6e0628..02c2226 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,7 @@ that this requires GoogleTest to be installed. cmake \ -B build \ -S . \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=20 \ # Your extra arguments here. cmake --build build ctest --test-dir build @@ -69,7 +69,7 @@ Example commands: cmake \ -B build \ -S . \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake cmake --build build ctest --test-dir build diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 06c079e..90ee952 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,7 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set(ALL_EXAMPLES example) - message("Examples to be built: ${ALL_EXAMPLES}") foreach(example ${ALL_EXAMPLES}) diff --git a/infra/.beman_submodule b/infra/.beman_submodule index 28a0600..424d64e 100644 --- a/infra/.beman_submodule +++ b/infra/.beman_submodule @@ -1,3 +1,3 @@ [beman_submodule] remote=https://github.com/bemanproject/infra.git -commit_hash=63cb577f6484f13ce3349de49ad5ce27e20bf1da +commit_hash=54dcdad8b661a405a6ac06453f0f06da5d30ba5c diff --git a/infra/cmake/beman-install-library.cmake b/infra/cmake/beman-install-library.cmake index 8a6c5a1..a77ee1a 100644 --- a/infra/cmake/beman-install-library.cmake +++ b/infra/cmake/beman-install-library.cmake @@ -56,7 +56,7 @@ include(GNUInstallDirs) # HEADERS to the default CMAKE install destination. # # It also handles the installation of the CMake config package files if -# needed. If the given targets has FILE_SET CXX_MODULE, it will also +# needed. If the given targets has a PUBLIC FILE_SET CXX_MODULE, it will also # installed to the given DESTINATION # # Cache variables: @@ -72,7 +72,7 @@ include(GNUInstallDirs) # Caveats # ------- # -# **Only one `FILE_SET CXX_MODULES` is yet supported to install with this +# **Only one `PUBLIC FILE_SET CXX_MODULES` is yet supported to install with this # function!** # # **Only header files contained in a `PUBLIC FILE_SET TYPE HEADERS` will be @@ -189,12 +189,12 @@ function(beman_install_library name) set(_install_header_set_args FILE_SET HEADERS) # Note: empty FILE_SET in this case! CK endif() - # Detect presence of C++ module file sets, exact one expected! - get_target_property(_module_sets "${_tgt}" CXX_MODULE_SETS) + # Detect presence of PUBLIC C++ module file sets. Note: exact one is expected! + get_target_property(_module_sets "${_tgt}" INTERFACE_CXX_MODULE_SETS) if(_module_sets) message( VERBOSE - "beman-install-library(${name}): '${_tgt}' has CXX_MODULE_SETS=${_module_sets}" + "beman-install-library(${name}): '${_tgt}' has INTERFACE_CXX_MODULE_SETS=${_module_sets}" ) install( TARGETS "${_tgt}" diff --git a/infra/cmake/use-fetch-content.cmake b/infra/cmake/use-fetch-content.cmake index 4ed4839..eb22be4 100644 --- a/infra/cmake/use-fetch-content.cmake +++ b/infra/cmake/use-fetch-content.cmake @@ -170,6 +170,18 @@ function(BemanExemplar_provideDependency method package_name) set(INSTALL_GTEST OFF) # Disable GoogleTest installation FetchContent_MakeAvailable("${BemanExemplar_name}") + # Catch2's CTest integration module isn't on CMAKE_MODULE_PATH + # when brought in via FetchContent. Add it so that + # `include(Catch)` works. + if(BemanExemplar_pkgName STREQUAL "Catch2") + list( + APPEND + CMAKE_MODULE_PATH + "${${BemanExemplar_name}_SOURCE_DIR}/extras" + ) + set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE) + endif() + # Important! _FOUND tells CMake that `find_package` is # not needed for this package anymore set("${BemanExemplar_pkgName}_FOUND" TRUE PARENT_SCOPE) diff --git a/tests/beman/cstring_view/CMakeLists.txt b/tests/beman/cstring_view/CMakeLists.txt index 8634c70..68b6480 100644 --- a/tests/beman/cstring_view/CMakeLists.txt +++ b/tests/beman/cstring_view/CMakeLists.txt @@ -9,7 +9,7 @@ target_sources( ) target_link_libraries( beman.cstring_view.tests.cstring_view - PRIVATE beman::cstring_view GTest::gtest GTest::gtest_main + PRIVATE beman::cstring_view GTest::gtest_main ) include(GoogleTest)