-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (95 loc) · 3.17 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Coverage
on:
push:
pull_request:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux-coverage:
name: linux-coverage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: install-python-3
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: install-python-deps
run: |
python3 -m pip install --upgrade pip
pip3 install conan
- name: dependencies (debian-like)
run: |
sudo apt -y update
sudo apt -y install gcovr ninja-build clang-tidy doxygen plantuml lcov
- name: cmake-configure
run: |
cmake --preset=ci-ninja-coverage
- name: build
run: |
cmake --build ./build
shell: bash
- name: ctest
run: |
ctest --test-dir build
shell: bash
# Note in order for ctest -T Coverage to work the tests have to be executed first
# with ctest. Moving this before the test step breaks coverage
- name: coverage gcov
run: |
mkdir -p gcov-coverage
gcovr -r ../ . -e '_deps' -e '(.+/)bertrand.hpp' -e '(.+/)CMakeCXXCompilerId.cpp' --html-details -o gcov-coverage/coverage.html
lcov -c -d . -o lcov.info
genhtml -o lcov-coverage lcov.info
working-directory: ./build
- name: archive coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: |
./build/gcov-coverage/
./build/lcov-coverage/
windows-coverage:
name: windows-coverage
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: install-python-3
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: install-python-deps
run: |
python3 -m pip install --upgrade pip
pip3 install conan
- name: dependencies (windows)
run: |
choco install -y --limit-output ninja opencppcoverage
choco install -y --limit-output openssl --version="3.1.1"
- name: correct-tmp-dir (win)
run: |
echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
shell: pwsh
- name: cmake-configure
run: |
cmake --preset=ci-msvc-22
- name: build
run: |
cmake --build --preset=ci-msvc-debug
- name: coverage openCppCoverage
run: |
"C:\\Program Files\\OpenCppCoverage\\OpenCppCoverage.exe" --modules ${{github.workspace}} --sources ${{ github.workspace }} --cover_children --export_type html:opencppcoverage/opencppcoverage --excluded_modules=*ctest* -- "C:\\Program Files\\CMake\\bin\\ctest.exe" --build-config Debug
shell: cmd
working-directory: ./build
- name: archive coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: |
./build/opencppcoverage