-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (116 loc) · 3.84 KB
/
Copy pathcoverage-pages.yml
File metadata and controls
142 lines (116 loc) · 3.84 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Coverage Report ≥ 80%
on:
push:
branches: [main]
paths:
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'external/**'
- 'include/**'
- 'src/**'
- 'tests/**'
- '.github/workflows/coverage-pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
env:
MINGW_BIN: C:\mingw64\bin
jobs:
mingw-coverage:
name: MinGW Build, Test & Coverage Artifact
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: "recursive"
- name: Add MinGW to PATH
run: echo "${{ env.MINGW_BIN }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell
- name: Cache pip packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~\AppData\Local\pip\Cache
key: pip-gcovr-${{ runner.os }}
restore-keys: pip-gcovr-
- name: Install gcovr
run: pip install "gcovr>=6.0"
shell: powershell
- name: Configure (Debug + Tests + Coverage)
run: cmake --preset mingw-debug -DDMK_ENABLE_COVERAGE=ON
shell: bash
- name: Build
run: cmake --build --preset mingw-debug --parallel
shell: bash
- name: Copy MinGW runtime DLLs
run: |
$testDir = "build\mingw-debug\tests"
Get-ChildItem "${{ env.MINGW_BIN }}\lib*.dll" | ForEach-Object {
Copy-Item $_.FullName "$testDir\"
}
shell: powershell
- name: Run Tests
# CTest runs each test case in its own process for state isolation between
# suites (see pr-check.yml). The per-test .gcda coverage data accumulates
# across those processes, so the gcovr step below still sees full coverage.
run: ctest --preset mingw-debug
shell: bash
- name: Generate HTML Coverage Report
run: |
mkdir -p coverage-report
gcovr \
--root . \
--filter "src/" \
--filter "include/" \
--exclude "external/" \
--exclude "build/" \
--exclude "tests/" \
--gcov-ignore-parse-errors=negative_hits.warn_once_per_file \
--fail-under-line 80 \
--print-summary \
--html-details coverage-report/index.html \
build/mingw-debug
shell: bash
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: coverage-report
msvc-verify:
name: MSVC Build & Test
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: "recursive"
- name: Set up MSVC developer environment
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
with:
arch: x64
- name: Configure (MSVC Debug + Tests)
run: cmake --preset msvc-debug
shell: cmd
- name: Build
run: cmake --build --preset msvc-debug --parallel
shell: cmd
- name: Run Tests
run: ctest --preset msvc-debug
shell: cmd
deploy-pages:
name: Deploy Coverage Report
runs-on: ubuntu-latest
needs: [mingw-coverage, msvc-verify]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0