-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (42 loc) · 1.21 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
name: coverage
on:
push:
branches:
- master
jobs:
codecoverage:
runs-on: windows-2022
name: Generate and upload code coverage
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Boost
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.83.0
toolset: msvc
platform_version: 2022
- name: Install packages
run: choco install opencppcoverage
- name: Configure
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
shell: bash
run: cmake -B build -T v143 -DENABLE_DOCUMENTATION=OFF
- name: Build
run: cmake --build build/ --target unittest
- name: Generate code coverage
shell: bash
run: exec "${PROGRAMFILES}"/opencppcoverage/opencppcoverage --cover_children --sources="${GITHUB_WORKSPACE}"\\include --modules=unittest.exe --export_type=cobertura:cobertura.xml -- ctest
working-directory: build/
env:
CTEST_OUTPUT_ON_FAILURE: True
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
files: build/cobertura.xml
fail_ci_if_error: true