Skip to content

Comments

Add macOS and Windows code coverage builds#163

Merged
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:pr/win-mac-coverage
Feb 23, 2026
Merged

Add macOS and Windows code coverage builds#163
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:pr/win-mac-coverage

Conversation

@mvandeberg
Copy link
Contributor

@mvandeberg mvandeberg commented Feb 23, 2026

Summary by CodeRabbit

Release Notes

  • Chores

    • Restructured continuous integration pipeline with dedicated builds for Linux, macOS, and Windows platforms
    • Implemented platform-specific code coverage generation and artifact management in deployment workflow
  • Documentation

    • Updated status table to display separate code coverage metrics for each supported operating system

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95287eb and 8019d73.

📒 Files selected for processing (2)
  • .github/workflows/code-coverage.yml
  • README.md

📝 Walkthrough

Walkthrough

The pull request restructures the code coverage CI/CD pipeline from a matrix-based single job into separate per-platform jobs for Linux, macOS, and Windows. Each platform job handles its own build, test, and coverage generation steps. The deployment workflow now aggregates coverage artifacts from all platforms, organizes them into per-OS directories, and creates navigation pages. The README badge table is expanded to display three separate coverage columns (one per platform) replacing the single coverage column.

Changes

Cohort / File(s) Summary
CI/CD Workflow Restructuring
.github/workflows/code-coverage.yml
Refactored from matrix-based to per-platform jobs (build-linux, build-macos, build-windows). Each platform job includes platform-specific setup, dependency patching, vcpkg configuration, coverage generation, and artifact uploading. Deploy job now downloads all platform artifacts, builds per-platform coverage directories (gcovr-linux, gcovr-macos, gcovr-windows), creates per-branch and root index pages, and handles per-OS navigation.
Documentation Badge Updates
README.md
Updated badge table from single "Code Coverage" column to three separate columns: "Coverage (Linux)", "Coverage (macOS)", and "Coverage (Windows)". Both master and develop rows now display per-OS badges and links instead of a single coverage badge.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #157: Introduced the baseline single-code-coverage workflow and README badge structure that this PR expands into per-platform coverage jobs.
  • PR #158: Contains overlapping modifications to .github/workflows/code-coverage.yml affecting gh_pages_dir layout, branch handling, and gcovr artifact publishing logic.

Poem

🐰 Three platforms now dance in the CI light,
Linux, macOS, Windows—all shining bright,
Coverage badges bloom in the README's glow,
Per-OS dashboards help the metrics flow,
Artifacts gather where workflows align! 📊

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add macOS and Windows code coverage builds' directly and clearly describes the main change: expanding code coverage CI/CD to include macOS and Windows platforms alongside the existing Linux coverage.

✏️ 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 Feb 23, 2026

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

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

2026-02-23 20:20:44 UTC

@cppalliance-bot
Copy link

cppalliance-bot commented Feb 23, 2026

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

Build time: 2026-02-23 19:38:27 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: 1

🧹 Nitpick comments (4)
.github/workflows/code-coverage.yml (2)

373-375: Deploy runs even when all builds fail.

The if: ${{ !cancelled() }} condition means deploy executes even if every build job fails (only skipping on workflow cancellation). While the copy step gracefully handles missing artifacts, you could tighten this to require at least one successful build to avoid pointless deploy commits.

♻️ Suggested condition
-    if: ${{ !cancelled() }}
+    if: ${{ !cancelled() && (needs.build-linux.result == 'success' || needs.build-macos.result == 'success' || needs.build-windows.result == 'success') }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/code-coverage.yml around lines 373 - 375, The deploy job
currently only checks for cancellation (if: ${{ !cancelled() }}) so it runs even
when all builds fail; update the deploy job's if condition to require at least
one upstream build success and not cancelled by replacing the existing condition
with a compound check against the three needs results (e.g., ensure
needs.build-linux.result == 'success' || needs.build-macos.result == 'success'
|| needs.build-windows.result == 'success' combined with !cancelled()),
referencing the deploy job and the
needs.build-linux/needs.build-macos/needs.build-windows result symbols to locate
where to change the condition.

415-433: Stale platform coverage data is preserved when a build fails.

When a platform build fails, its artifact won't exist and the if [ -d ... ] check skips the copy — but the old gcovr-<platform> directory from a prior run is not removed either. This means the deployed page silently serves stale data for that platform. If carryforward: true in Codecov is the intended model, this is fine, but consider adding a note or logging a warning so it's visible in the deploy output.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/code-coverage.yml around lines 415 - 433, The "Copy
coverage results" step currently skips missing platform artifacts and leaves
stale gh_pages_dir/${GITHUB_REF_NAME}/gcovr-<platform> directories; update the
loop that checks coverage-artifacts/coverage-${platform} so that when the
artifact directory is absent you explicitly remove the corresponding
gh_pages_dir/${GITHUB_REF_NAME}/gcovr-${platform} (rm -rf) and/or emit a clear
warning message (echo) referencing the platform and GITHUB_REF_NAME; ensure the
logic around the for loop and the conditional uses the same platform variable
names so stale data is removed and a visible log entry is produced when a
platform build failed.
.github/workflows/ci.yml (1)

960-981: Coverage report generation for macOS and Windows looks correct.

One subtle difference worth noting: the macOS step (line 964) uses pip3 install --break-system-packages gcovr while the Windows step (line 976) uses pip3 install gcovr. This is correct — macOS system Python (managed by Homebrew) requires the --break-system-packages flag — but consider adding a brief inline comment on each pip3 install line to explain the difference, to prevent future contributors from "fixing" the inconsistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 960 - 981, Add short inline comments
next to the pip3 install lines in the "Generate Coverage Report (macOS)" and
"Generate Coverage Report (Windows)" steps explaining why macOS uses
--break-system-packages (to override Homebrew/system Python protections) and
Windows does not; update the pip3 install in the macOS step (inside the step
named "Generate Coverage Report (macOS)") to retain --break-system-packages and
add a one-line comment, and add a matching one-line comment to the pip3 install
in the step named "Generate Coverage Report (Windows)" clarifying the platform
difference so future contributors don't remove the flag.
README.md (1)

1-4: Consider using distinct alt text for coverage badges.

All six coverage badge images use Lines as alt text. When rendered without images (e.g., screen readers, slow connections), users see six identical "Lines" links with no way to distinguish them. Consider using platform-specific alt text like Linux Coverage, macOS Coverage, Windows Coverage.

♻️ Suggested diff (master row shown; apply similarly to develop)
-| [![Lines](https://cppalliance.org/corosio/master/gcovr-linux/badges/coverage-lines.svg)](https://cppalliance.org/corosio/master/gcovr-linux/index.html) | [![Lines](https://cppalliance.org/corosio/master/gcovr-macos/badges/coverage-lines.svg)](https://cppalliance.org/corosio/master/gcovr-macos/index.html) | [![Lines](https://cppalliance.org/corosio/master/gcovr-windows/badges/coverage-lines.svg)](https://cppalliance.org/corosio/master/gcovr-windows/index.html) |
+| [![Linux Coverage](https://cppalliance.org/corosio/master/gcovr-linux/badges/coverage-lines.svg)](https://cppalliance.org/corosio/master/gcovr-linux/index.html) | [![macOS Coverage](https://cppalliance.org/corosio/master/gcovr-macos/badges/coverage-lines.svg)](https://cppalliance.org/corosio/master/gcovr-macos/index.html) | [![Windows Coverage](https://cppalliance.org/corosio/master/gcovr-windows/badges/coverage-lines.svg)](https://cppalliance.org/corosio/master/gcovr-windows/index.html) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 1 - 4, The coverage badge images in the README table
all share the same alt text "Lines", making them indistinguishable to screen
readers; update the markdown image alt text for each coverage badge (the six
occurrences of https://cppalliance.org/corosio/.../badges/coverage-lines.svg in
both the `master` and `develop` rows) to unique, platform-specific labels such
as "Linux Coverage", "macOS Coverage", and "Windows Coverage" so each badge link
is descriptive and accessible.
🤖 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/code-coverage.yml:
- Around line 88-228: The macOS (build-macos) and Windows (build-windows)
coverage jobs omit TLS deps, so TLS tests get skipped; add the same
vcpkg/WolfSSL/OpenSSL setup used in ci.yml: create a vcpkg.json with wolfssl,
add a step to bootstrap and install vcpkg packages, ensure OpenSSL is installed
(Homebrew on macOS, MSYS2 on Windows MinGW), and pass CMake variables into the
Build with coverage step (extra-args) to set CMAKE_WOLFSSL_INCLUDE and
CMAKE_WOLFSSL_LIBRARY and OpenSSL include/library paths so CMake can find
WolfSSL/OpenSSL during the Build with coverage job and include TLS code paths in
coverage reports.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 960-981: Add short inline comments next to the pip3 install lines
in the "Generate Coverage Report (macOS)" and "Generate Coverage Report
(Windows)" steps explaining why macOS uses --break-system-packages (to override
Homebrew/system Python protections) and Windows does not; update the pip3
install in the macOS step (inside the step named "Generate Coverage Report
(macOS)") to retain --break-system-packages and add a one-line comment, and add
a matching one-line comment to the pip3 install in the step named "Generate
Coverage Report (Windows)" clarifying the platform difference so future
contributors don't remove the flag.

In @.github/workflows/code-coverage.yml:
- Around line 373-375: The deploy job currently only checks for cancellation
(if: ${{ !cancelled() }}) so it runs even when all builds fail; update the
deploy job's if condition to require at least one upstream build success and not
cancelled by replacing the existing condition with a compound check against the
three needs results (e.g., ensure needs.build-linux.result == 'success' ||
needs.build-macos.result == 'success' || needs.build-windows.result == 'success'
combined with !cancelled()), referencing the deploy job and the
needs.build-linux/needs.build-macos/needs.build-windows result symbols to locate
where to change the condition.
- Around line 415-433: The "Copy coverage results" step currently skips missing
platform artifacts and leaves stale
gh_pages_dir/${GITHUB_REF_NAME}/gcovr-<platform> directories; update the loop
that checks coverage-artifacts/coverage-${platform} so that when the artifact
directory is absent you explicitly remove the corresponding
gh_pages_dir/${GITHUB_REF_NAME}/gcovr-${platform} (rm -rf) and/or emit a clear
warning message (echo) referencing the platform and GITHUB_REF_NAME; ensure the
logic around the for loop and the conditional uses the same platform variable
names so stale data is removed and a visible log entry is produced when a
platform build failed.

In `@README.md`:
- Around line 1-4: The coverage badge images in the README table all share the
same alt text "Lines", making them indistinguishable to screen readers; update
the markdown image alt text for each coverage badge (the six occurrences of
https://cppalliance.org/corosio/.../badges/coverage-lines.svg in both the
`master` and `develop` rows) to unique, platform-specific labels such as "Linux
Coverage", "macOS Coverage", and "Windows Coverage" so each badge link is
descriptive and accessible.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57c6600 and 95287eb.

📒 Files selected for processing (4)
  • .codecov.yml
  • .github/workflows/ci.yml
  • .github/workflows/code-coverage.yml
  • README.md

@mvandeberg mvandeberg merged commit f5ed1d2 into cppalliance:develop Feb 23, 2026
14 of 18 checks passed
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.

2 participants