-
Notifications
You must be signed in to change notification settings - Fork 530
249 lines (240 loc) · 9.92 KB
/
code-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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: Code Coverage
on:
workflow_dispatch:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
concurrency:
# Cancel any workflow currently in progress for the same PR.
# Allow running concurrently with any other commits.
group: codecoverage-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: read-all
jobs:
build-windows:
name: Build WinUser
strategy:
fail-fast: false
matrix:
vec: [
{ config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "openssl", build: "-Test" },
]
uses: ./.github/workflows/build-reuse-win.yml
with:
config: ${{ matrix.vec.config }}
plat: ${{ matrix.vec.plat }}
os: ${{ matrix.vec.os }}
arch: ${{ matrix.vec.arch }}
tls: ${{ matrix.vec.tls }}
sanitize: ${{ matrix.vec.sanitize }}
build: ${{ matrix.vec.build }}
bvt-winlatest:
name: BVT WinPrerelease
needs: [build-windows]
strategy:
fail-fast: false
matrix:
vec: [
{ config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "openssl", build: "-Test" },
]
runs-on:
- self-hosted
- "1ES.Pool=1es-msquic-pool"
- "1ES.ImageOverride=WinServerPrerelease"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Download Build Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: ${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.sanitize }}${{ matrix.vec.build }}
path: artifacts
- name: Prepare Machine
run: scripts/prepare-machine.ps1 -Tls ${{ matrix.vec.tls }} -ForTest -InstallCodeCoverage
shell: pwsh
- name: Install ETW Manifest
shell: pwsh
run: |
$MsQuicDll = ".\artifacts\bin\windows\${{ matrix.vec.arch }}_${{ matrix.vec.config }}_${{ matrix.vec.tls }}\msquic.dll"
$ManifestPath = ".\src\manifest\MsQuicEtw.man"
wevtutil.exe um $ManifestPath
wevtutil.exe im $ManifestPath /rf:$($MsQuicDll) /mf:$($MsQuicDll)
- name: Test
shell: pwsh
timeout-minutes: 120
continue-on-error: true
run: scripts/test.ps1 -NoProgress -IsolationMode Batch -SkipUnitTests -CodeCoverage -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -LogProfile Full.Light ${{ matrix.vec.xdp }} ${{ matrix.vec.qtip }}
- name: Upload Results
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: BVT-${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.qtip }}${{ matrix.vec.systemcrypto }}${{ matrix.vec.sanitize }}
path: artifacts/coverage/*.cov
stress-winlatest:
name: Stress WinPrerelease
needs: [build-windows]
strategy:
fail-fast: false
matrix:
vec: [
{ config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "openssl", build: "-Test" },
]
runs-on:
- self-hosted
- "1ES.Pool=1es-msquic-pool"
- "1ES.ImageOverride=WinServerPrerelease"
env:
main-timeout: 3600000
main-repeat: 100
main-allocfail: 100
pr-timeout: 600000
pr-repeat: 20
pr-allocfail: 100
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: ${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.sanitize }}${{ matrix.vec.build }}
path: artifacts
- name: Prepare Machine
run: scripts/prepare-machine.ps1 -Tls ${{ matrix.vec.tls }} -ForTest ${{ matrix.vec.xdp }} -InstallCodeCoverage
shell: pwsh
- name: spinquic (PR)
if: github.event_name == 'pull_request'
timeout-minutes: 15
continue-on-error: true
shell: pwsh
run: scripts/spin.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -Timeout ${{ env.pr-timeout }} -RepeatCount ${{ env.pr-repeat }} -AllocFail ${{ env.pr-allocfail }} ${{ matrix.vec.xdp }} -CodeCoverage -LogProfile Basic.Light
- name: spinquic (Official)
if: github.event_name != 'pull_request'
timeout-minutes: 65
continue-on-error: true
shell: pwsh
run: scripts/spin.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -Timeout ${{ env.main-timeout }} -RepeatCount ${{ env.main-repeat }} -AllocFail ${{ env.main-allocfail }} ${{ matrix.vec.xdp }} -CodeCoverage -LogProfile Basic.Light
- name: Upload Results
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: Spin-${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}${{ matrix.vec.sanitize }}
path: artifacts/coverage/*.cov
recvfuzz-winlatest:
name: Recv Fuzz WinPrerelease
needs: [build-windows]
strategy:
fail-fast: false
matrix:
vec: [
{ config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "openssl", build: "-Test" },
]
runs-on:
- self-hosted
- "1ES.Pool=1es-msquic-pool"
- "1ES.ImageOverride=WinServerPrerelease"
env:
main-timeout: 3600000
pr-timeout: 600000
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: ${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.sanitize }}${{ matrix.vec.build }}
path: artifacts
- name: Prepare Machine
run: scripts/prepare-machine.ps1 -Tls ${{ matrix.vec.tls }} -ForTest ${{ matrix.vec.xdp }} -InstallCodeCoverage
shell: pwsh
- name: recvfuzz (PR)
if: github.event_name == 'pull_request'
timeout-minutes: 15
continue-on-error: true
shell: pwsh
run: scripts/recvfuzz.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -timeout ${{ env.pr-timeout }} ${{ matrix.vec.xdp }} -CodeCoverage -LogProfile Basic.Light
- name: recvfuzz (Official)
if: github.event_name != 'pull_request'
timeout-minutes: 65
continue-on-error: true
shell: pwsh
run: scripts/recvfuzz.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -timeout ${{ env.main-timeout }} ${{ matrix.vec.xdp }} -CodeCoverage -LogProfile Basic.Light
- name: Upload Results
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: RecvFuzz-${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}${{ matrix.vec.sanitize }}
path: artifacts/coverage/*.cov
merge-coverage:
name: Merge Coverage
needs: [bvt-winlatest, stress-winlatest, recvfuzz-winlatest]
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Prepare Machine
run: scripts/prepare-machine.ps1 -ForTest -InstallCodeCoverage
shell: pwsh
- name: Create Folder for Artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path artifacts\coverage\windows\x64_Debug_openssl
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
name: Download BVT Coverage Results
with:
name: BVT-Debug-windows-windows-2022-x64-openssl
path: artifacts\coverage\windows\x64_Debug_openssl
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
name: Download SpinQuic Coverage Results
with:
name: Spin-Debug-windows-windows-2022-x64-openssl
path: artifacts\coverage\windows\x64_Debug_openssl
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
name: Download RecvFuzz Coverage Results
with:
name: RecvFuzz-Debug-windows-windows-2022-x64-openssl
path: artifacts\coverage\windows\x64_Debug_openssl
- name: Dir Folder for Artifacts
shell: pwsh
run: |
dir artifacts\coverage\windows\x64_Debug_openssl
- name: Merge
shell: pwsh
run: scripts/merge-coverage.ps1 -Config Debug -Arch x64 -Tls openssl
- name: Upload Results
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: merged
path: artifacts\coverage\windows\x64_Debug_openssl\msquiccoverage.xml
publish-coverage:
name: Generate Summary
needs: [merge-coverage]
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
name: Download Merged Coverage Report
with:
name: merged
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
with:
fail_ci_if_error: true
files: msquiccoverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95
with:
filename: msquiccoverage.xml
badge: true
format: 'markdown'
output: 'both'
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY