Skip to content

Align CI with CMake standards: dedicated build modes and matrix fixes#199

Merged
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:pr/186-ci-coverage
Mar 11, 2026
Merged

Align CI with CMake standards: dedicated build modes and matrix fixes#199
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:pr/186-ci-coverage

Conversation

@mvandeberg
Copy link
Contributor

@mvandeberg mvandeberg commented Mar 11, 2026

Closes #186

Key changes:

  • Dedicate a single superproject-cmake matrix entry (GCC latest) for CMake superproject build and both integration tests, moving sparse checkout disable behind the superproject-cmake flag
  • Run standalone CMake from library root (corosio-root) instead of boost-root, building all targets without a build-target filter
  • Add clang-tidy as standalone configure-only step against corosio-root with version-parametric binary and include/src file filtering
  • Add FlameGraph compile-time profiling for Clang time-trace variant
  • Gate B2 on !coverage && !time-trace && !superproject-cmake && !clang-tidy
  • Gate standalone CMake on build-cmake || coverage
  • Add is_earliest to GCC 12, Clang 17, MSVC 14.34, Apple-Clang macos-14 so oldest compilers also run standalone CMake builds
  • Fix generate-matrix.py to emit generator-toolset (hyphen) matching ci.yml references, and read shared/vcpkg_triplet from compiler specs
  • Skip ASAN+UBSAN variant for MinGW (limited sanitizer support)
  • Restore zip/unzip/tar packages needed by vcpkg in container builds
  • Update cmake_test version range to 3.13...3.31

Summary by CodeRabbit

  • Chores
    • Enhanced compiler metadata to mark earliest toolchain entries.
    • Expanded CI matrix and workflows to support new build variants (time-trace, superproject-CMake) and improved cross-platform handling.
    • Integrated clang-tidy checks and FlameGraph generation into CI.
    • Updated coverage and test artifact collection paths and refined MinGW/Windows/Linux build/setup steps.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

These changes mark earliest compiler entries in .fd.fxlcf.dpdns.orgpilers.json, add new matrix variant generators and clang-tidy integration in .github/generate-matrix.py, and restructure .github/workflows/ci.yml to emit and run additional CI variants (time-trace, superproject-CMake, sanitizer/coverage, clang-tidy) and to switch between standalone (corosio-root) and superproject flows.

Changes

Cohort / File(s) Summary
Compiler Metadata
\.fd.fxlcf.dpdns.orgpilers.json
Added is_earliest: true to earliest entries for gcc (12), clang (17), msvc (14.34), and apple-clang (*). Minor comma/line adjustments only.
Matrix Generation Logic
\.github/generate-matrix.py
Added generate_time_trace_variant, generate_superproject_cmake_variant, and apply_clang_tidy. Reworked platform representation from per-platform booleans to a single platform name key, propagated shared/vcpkg-triplet fields, adjusted build-cmake behavior for earliest/latest, added new variant emission paths (time-trace, superproject-CMake, sanitizer/coverage), updated job naming (x86, time-trace, superproject-CMake), and integrated clang-tidy augmentation.
CI Workflow Execution
\.github/workflows/ci.yml
Conditionally gates jobs on matrix.superproject-cmake, adds MSYS2/MinGW Clang setup, adjusts sparse-checkout for superproject builds, moves many artifact/coverage paths from boost-root to corosio-root, raises minimum CMake to >=3.20 in spots, adds clang-tidy and FlameGraph steps, refactors ASAN/UBSAN/coverage handling per platform, and updates build/install steps for Boost B2 and CMake flows.

Sequence Diagram(s)

sequenceDiagram
    participant MatrixGen as Matrix Generator
    participant GH_Actions as GitHub Actions Matrix
    participant Runner as Job Runner
    participant Build as Build System (CMake/B2)
    participant Tools as Post-build Tools (clang-tidy, FlameGraph, Coverage)

    MatrixGen->>GH_Actions: emit matrix rows (time-trace, superproject-CMake, sanitizer, coverage, clang-tidy)
    GH_Actions->>Runner: schedule job with matrix entry
    Runner->>Build: checkout + (sparse-checkout if superproject?) + configure (CMake/B2) 
    alt superproject
        Build->>Build: build within Boost superproject
    else standalone
        Build->>Build: build corosio-root with FetchContent deps
    end
    Build->>Tools: run tests, optionally emit compile_commands.json
    opt clang-tidy
        Tools->>Tools: run clang-tidy over corosio-root/__build__/compile_commands.json
    end
    opt time-trace / FlameGraph
        Tools->>Tools: collect and process time-trace data -> FlameGraph
    end
    Tools->>Runner: upload coverage/artifacts (corosio-root/__build__/coverage.info)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 I hopped through JSON, matrix, and CMake bright,

Flavored jobs with trace and clang-tidy delight.
From superproject branches to standalone root song,
The CI sings loudly—builds all night long! 🎩✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: aligning CI with CMake standards by introducing dedicated build modes (superproject-cmake, standalone) and fixing the matrix configuration.
Linked Issues check ✅ Passed The PR successfully addresses all core requirements from issue #186: adds standalone CMake builds (corosio-root), ensures superproject builds, enables all build options (tests, examples, benchmarks), and covers both build modes with appropriate matrix entries.
Out of Scope Changes check ✅ Passed All changes are in-scope: compiler configuration updates (is_earliest flags), matrix generation logic enhancements, and CI workflow modifications align with the stated objective of building all targets in both modes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cppalliance-bot
Copy link

cppalliance-bot commented Mar 11, 2026

An automated preview of the documentation is available at https://199.corosio.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-03-11 18:01:51 UTC

@cppalliance-bot
Copy link

cppalliance-bot commented Mar 11, 2026

GCOVR code coverage report https://199.corosio.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://199.corosio.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://199.corosio.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-03-11 18:12:47 UTC

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

591-615: ⚠️ Potential issue | 🟠 Major

Enable tests, examples, and perf explicitly in the standalone CMake lane.

Lines 607-614 never turn on BOOST_COROSIO_BUILD_TESTS, BOOST_COROSIO_BUILD_EXAMPLES, or BOOST_COROSIO_BUILD_PERF. If any of those defaults is off, this job can go green without compiling the target categories issue #186 asked CI to cover.

Suggested change
         extra-args: |
           -D Boost_VERBOSE=ON
+          -D BOOST_COROSIO_BUILD_TESTS=ON
+          -D BOOST_COROSIO_BUILD_EXAMPLES=ON
+          -D BOOST_COROSIO_BUILD_PERF=ON
           ${{ matrix.compiler == 'mingw' && '-D CMAKE_VERBOSE_MAKEFILE=ON' || '' }}
           ${{ contains(matrix.generator || '', 'Visual Studio') && format('-D CMAKE_CONFIGURATION_TYPES={0}', matrix.build-type) || '' }}
           ${{ env.CMAKE_WOLFSSL_INCLUDE && format('-D WolfSSL_INCLUDE_DIR={0}', env.CMAKE_WOLFSSL_INCLUDE) || '' }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 591 - 615, The CI workflow's CMake
invocation (extra-args in the job) doesn't explicitly enable
BOOST_COROSIO_BUILD_TESTS, BOOST_COROSIO_BUILD_EXAMPLES, or
BOOST_COROSIO_BUILD_PERF, so add flags to the extra-args block to force them on
(e.g. pass -D BOOST_COROSIO_BUILD_TESTS=ON, -D BOOST_COROSIO_BUILD_EXAMPLES=ON,
-D BOOST_COROSIO_BUILD_PERF=ON) alongside the other -D options so the standalone
CMake lane always builds tests, examples, and perf regardless of CMake defaults.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 112-117: The workflow installs the MSYS2 clang64 tree but leaves
environment/runtime variables and later Windows MinGW paths pointing to the
gcc/mingw toolchain, producing a mixed configuration; in the "Setup MSYS2 (MinGW
Clang)" step (matrix.compiler == 'mingw') update the environment and PATH to
finish the toolchain switch by exporting/setting cxx=clang++, cc=clang,
b2_toolset=clang (or equivalent CI env names used elsewhere) and replace later
references to mingw64 toolchain roots with the clang64 root (e.g., ensure
"C:/msys64/clang64/bin" is placed before any mingw64 paths and any uses of
g++/gcc are changed to clang++/clang for that matrix entry) so the job
consistently uses the clang64 toolchain.
- Around line 491-499: The CI job gated by matrix.superproject-cmake currently
restricts CMake to a single target via build-target: boost_corosio_tests which
prevents building the full superproject graph (libraries, TLS providers,
examples, benchmarks); remove or change the build-target key (or set it to a
full-build target such as ALL_BUILD or run with no build-target) in that job so
the CMake run using source-dir: boost-root and build-dir: __build_cmake_test__
builds the entire superproject matrix (ensuring generator, generator-toolset and
build-type still apply) and enable run-tests as needed to exercise the full
outputs.
- Around line 620-635: The clang-tidy configure job ("Configure for clang-tidy"
that uses alandefreitas/cpp-actions/cmake-workflow) only sets
CMAKE_EXPORT_COMPILE_COMMANDS but omits the dependency/vcpkg inputs used by the
standalone CMake build; update that job to pass the same dependency inputs (the
same WolfSSL/OpenSSL/vcpkg-related input keys used in the standalone build job)
and any related step outputs (e.g. vcpkg-root, vcpkg-triplet, wolfssl/openssl
version inputs or step outputs) so the configure-only run produces the same
target graph and can configure successfully; ensure the cc/cxx/generator/cxxstd
inputs remain identical to the standalone build so compile_commands.json matches
the real build.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 591-615: The CI workflow's CMake invocation (extra-args in the
job) doesn't explicitly enable BOOST_COROSIO_BUILD_TESTS,
BOOST_COROSIO_BUILD_EXAMPLES, or BOOST_COROSIO_BUILD_PERF, so add flags to the
extra-args block to force them on (e.g. pass -D BOOST_COROSIO_BUILD_TESTS=ON, -D
BOOST_COROSIO_BUILD_EXAMPLES=ON, -D BOOST_COROSIO_BUILD_PERF=ON) alongside the
other -D options so the standalone CMake lane always builds tests, examples, and
perf regardless of CMake defaults.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cc32f87e-2707-4006-a5d6-d8c05f1b6299

📥 Commits

Reviewing files that changed from the base of the PR and between 504d294 and aab241c.

⛔ Files ignored due to path filters (2)
  • perf/bench/CMakeLists.txt is excluded by !**/bench/**
  • test/cmake_test/CMakeLists.txt is excluded by !**/test/**
📒 Files selected for processing (3)
  • .fd.fxlcf.dpdns.orgpilers.json
  • .github/generate-matrix.py
  • .github/workflows/ci.yml

…cppalliance#186)

Key changes:
- Dedicate a single superproject-cmake matrix entry (GCC latest) for
  CMake superproject build and both integration tests, moving sparse
  checkout disable behind the superproject-cmake flag
- Run standalone CMake from library root (corosio-root) instead of
  boost-root, building all targets without a build-target filter
- Add clang-tidy as standalone configure-only step against corosio-root
  with version-parametric binary and include/src file filtering
- Add FlameGraph compile-time profiling for Clang time-trace variant
- Gate B2 on !coverage && !time-trace && !superproject-cmake && !clang-tidy
- Gate standalone CMake on build-cmake || coverage
- Add is_earliest to GCC 12, Clang 17, MSVC 14.34, Apple-Clang macos-14
  so oldest compilers also run standalone CMake builds
- Fix generate-matrix.py to emit generator-toolset (hyphen) matching
  ci.yml references, and read shared/vcpkg_triplet from compiler specs
- Skip ASAN+UBSAN variant for MinGW (limited sanitizer support)
- Restore zip/unzip/tar packages needed by vcpkg in container builds
- Update cmake_test version range to 3.13...3.31
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/generate-matrix.py (1)

93-99: ⚠️ Potential issue | 🟡 Minor

Keep the MinGW job label aligned with the compiler settings.

.fd.fxlcf.dpdns.orgpilers.json still drives this family with g++/gcc and b2_toolset: gcc, so renaming the lane to MinGW Clang will make the matrix name misleading.

Suggested fix
-        "mingw": "MinGW Clang",
+        "mingw": "MinGW",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/generate-matrix.py around lines 93 - 99, The matrix entry in
name_map for the mingw key is mislabeled as "MinGW Clang" which conflicts with
.fd.fxlcf.dpdns.orgpilers.json that uses the gcc toolset; update the name_map dictionary
so the "mingw" key maps to "MinGW" (e.g., change the value for the "mingw" entry
in the name_map variable) to keep the generated job name aligned with the actual
compiler settings.
🧹 Nitpick comments (1)
.github/generate-matrix.py (1)

277-280: Emit clang-tidy as an extra variant instead of rewriting the base Clang entry.

Line 279 repurposes the base latest-Clang job into a configure-only clang-tidy lane. That drops the plain x86_64 latest-Clang entry from the matrix and leaves only special-purpose variants behind.

Suggested fix
             # Base entry (x86_64 / default arch)
             base = make_entry(family, spec)
-            if spec.get("clang_tidy"):
-                apply_clang_tidy(base, spec)
             matrix.append(base)
+            if spec.get("clang_tidy"):
+                matrix.append(apply_clang_tidy(base.copy(), spec))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/generate-matrix.py around lines 277 - 280, The current loop uses
make_entry(...) to build base and then calls apply_clang_tidy(base, spec) which
mutates and replaces the original latest-Clang job; instead, preserve the plain
Clang entry and emit an additional clang-tidy variant: create base =
make_entry(family, spec) and always append it to matrix, then if
spec.get("clang_tidy") create a separate copy/variant (e.g., tidy_entry =
make_entry(family, spec) or clone base) and call apply_clang_tidy(tidy_entry,
spec) and append tidy_entry to matrix so both the standard x86_64 latest-Clang
job and the clang-tidy lane exist.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/generate-matrix.py:
- Around line 93-99: The matrix entry in name_map for the mingw key is
mislabeled as "MinGW Clang" which conflicts with .fd.fxlcf.dpdns.orgpilers.json that
uses the gcc toolset; update the name_map dictionary so the "mingw" key maps to
"MinGW" (e.g., change the value for the "mingw" entry in the name_map variable)
to keep the generated job name aligned with the actual compiler settings.

---

Nitpick comments:
In @.github/generate-matrix.py:
- Around line 277-280: The current loop uses make_entry(...) to build base and
then calls apply_clang_tidy(base, spec) which mutates and replaces the original
latest-Clang job; instead, preserve the plain Clang entry and emit an additional
clang-tidy variant: create base = make_entry(family, spec) and always append it
to matrix, then if spec.get("clang_tidy") create a separate copy/variant (e.g.,
tidy_entry = make_entry(family, spec) or clone base) and call
apply_clang_tidy(tidy_entry, spec) and append tidy_entry to matrix so both the
standard x86_64 latest-Clang job and the clang-tidy lane exist.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 868594f3-8d78-4654-916d-bcedea86512e

📥 Commits

Reviewing files that changed from the base of the PR and between aab241c and 49e35ea.

⛔ Files ignored due to path filters (2)
  • perf/bench/CMakeLists.txt is excluded by !**/bench/**
  • test/cmake_test/CMakeLists.txt is excluded by !**/test/**
📒 Files selected for processing (3)
  • .fd.fxlcf.dpdns.orgpilers.json
  • .github/generate-matrix.py
  • .github/workflows/ci.yml

@mvandeberg mvandeberg merged commit 6d10efa into cppalliance:develop Mar 11, 2026
40 of 41 checks passed
@mvandeberg mvandeberg deleted the pr/186-ci-coverage branch March 11, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: build all targets (library, tests, examples, benchmarks) standalone and in superproject

2 participants