Skip to content

Commit fbb82bc

Browse files
committed
Add Windows and MacOS coverage builds for PR preview
1 parent c0ae39b commit fbb82bc

File tree

2 files changed

+89
-10
lines changed

2 files changed

+89
-10
lines changed

.codecov.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Copyright 2019 - 2021 Alexander Grund
22
# Distributed under the Boost Software License, Version 1.0.
33
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
4-
#
5-
# Sample codecov configuration file. Edit as required
64

75
codecov:
86
max_report_age: off
97
require_ci_to_pass: yes
108
notify:
11-
# Increase this if you have multiple coverage collection jobs
12-
after_n_builds: 1
9+
# Three coverage builds: Linux (GCC), macOS (Apple-Clang), Windows (MinGW)
10+
after_n_builds: 3
1311
wait_for_ci: yes
1412

1513
# Fix paths from CI build to match repository structure
16-
# Coverage paths look like: /home/runner/work/corosio/corosio/boost-root/libs/corosio/include/...
17-
# Strip everything up to and including boost-root/libs/corosio/
14+
# Linux (lcov) paths: /home/runner/.../boost-root/libs/corosio/include/...
15+
# macOS/Windows (gcovr -r boost-root) paths: libs/corosio/include/...
16+
# Codecov applies fixes in order, first match wins.
1817
fixes:
1918
- "boost-root/libs/corosio/::"
19+
- "libs/corosio/::"
2020

2121
# Make coverage checks informational (report but never fail CI)
2222
coverage:
@@ -32,6 +32,24 @@ coverage:
3232
comment:
3333
layout: "reach,diff,flags,files,footer"
3434

35+
# Per-platform coverage flags
36+
flags:
37+
linux:
38+
paths:
39+
- include/
40+
- src/
41+
carryforward: true
42+
macos:
43+
paths:
44+
- include/
45+
- src/
46+
carryforward: true
47+
windows:
48+
paths:
49+
- include/
50+
- src/
51+
carryforward: true
52+
3553
# Ignore specific files or folders. Glob patterns are supported.
3654
# See https://docs.codecov.com/docs/ignoring-paths
3755
ignore:

.github/workflows/ci.yml

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,27 @@ jobs:
108108
build-cmake: true
109109
vcpkg-triplet: "x64-mingw-static"
110110

111-
# macOS (3 configurations)
112-
# Uses select backend (kqueue support planned for future)
111+
- compiler: "mingw"
112+
version: "*"
113+
cxxstd: "20"
114+
latest-cxxstd: "20"
115+
cxx: "g++"
116+
cc: "gcc"
117+
runs-on: "windows-2022"
118+
b2-toolset: "gcc"
119+
generator: "MinGW Makefiles"
120+
name: "MinGW: C++20 (coverage)"
121+
windows: true
122+
shared: false
123+
coverage: true
124+
coverage-flag: "windows"
125+
build-type: "Debug"
126+
cxxflags: "--coverage -fprofile-arcs -ftest-coverage -fprofile-update=atomic"
127+
ccflags: "--coverage -fprofile-arcs -ftest-coverage -fprofile-update=atomic"
128+
vcpkg-triplet: "x64-mingw-static"
129+
130+
# macOS (4 configurations)
131+
# kqueue is the default backend on macOS
113132
# Requires -fexperimental-library for std::stop_token support in libc++
114133

115134
- compiler: "apple-clang"
@@ -158,7 +177,24 @@ jobs:
158177
build-type: "Release"
159178
cxxflags: "-fexperimental-library"
160179

161-
# Linux GCC (4 configurations)
180+
- compiler: "apple-clang"
181+
version: "*"
182+
cxxstd: "20"
183+
latest-cxxstd: "20"
184+
cxx: "clang++"
185+
cc: "clang"
186+
runs-on: "macos-15"
187+
b2-toolset: "clang"
188+
name: "Apple-Clang (macOS 15, coverage): C++20"
189+
macos: true
190+
shared: false
191+
coverage: true
192+
coverage-flag: "macos"
193+
build-type: "Debug"
194+
cxxflags: "--coverage -fexperimental-library"
195+
ccflags: "--coverage"
196+
197+
# Linux GCC (5 configurations)
162198

163199
- compiler: "gcc"
164200
version: "15"
@@ -219,6 +255,7 @@ jobs:
219255
linux: true
220256
shared: false
221257
coverage: true
258+
coverage-flag: "linux"
222259
build-type: "Debug"
223260
cxxflags: "--coverage -fprofile-arcs -ftest-coverage -fprofile-update=atomic"
224261
ccflags: "--coverage -fprofile-arcs -ftest-coverage -fprofile-update=atomic"
@@ -903,7 +940,7 @@ jobs:
903940
ref-source-dir: boost-root
904941

905942
- name: Generate Coverage Report
906-
if: ${{ matrix.coverage }}
943+
if: ${{ matrix.coverage && matrix.linux }}
907944
run: |
908945
set -x
909946
@@ -920,11 +957,35 @@ jobs:
920957
--include "*/boost-root/libs/${{steps.patch.outputs.module}}/src/*" \
921958
--gcov-tool "$gcov_tool"
922959
960+
- name: Generate Coverage Report (macOS)
961+
if: ${{ matrix.coverage && matrix.macos }}
962+
run: |
963+
set -x
964+
pip3 install --break-system-packages gcovr
965+
gcovr \
966+
--gcov-executable "xcrun llvm-cov gcov" \
967+
-r boost-root \
968+
--filter ".*/libs/${{steps.patch.outputs.module}}/include/.*" \
969+
--filter ".*/libs/${{steps.patch.outputs.module}}/src/.*" \
970+
--lcov -o "boost-root/__build_cmake_test__/coverage.info"
971+
972+
- name: Generate Coverage Report (Windows)
973+
if: ${{ matrix.coverage && matrix.windows }}
974+
run: |
975+
set -x
976+
pip3 install gcovr
977+
gcovr \
978+
-r boost-root \
979+
--filter ".*/libs/${{steps.patch.outputs.module}}/include/.*" \
980+
--filter ".*/libs/${{steps.patch.outputs.module}}/src/.*" \
981+
--lcov -o "boost-root/__build_cmake_test__/coverage.info"
982+
923983
- name: Upload to Codecov
924984
if: ${{ matrix.coverage }}
925985
uses: codecov/codecov-action@v5
926986
with:
927987
files: boost-root/__build_cmake_test__/coverage.info
988+
flags: ${{ matrix.coverage-flag }}
928989
token: ${{ secrets.CODECOV_TOKEN }}
929990
fail_ci_if_error: false
930991
verbose: true

0 commit comments

Comments
 (0)