Skip to content

Commit b2282bb

Browse files
committed
Update command line args to lcov. We want to ignore any errors on files in /usr/*, not just exclude them. Windows, make sure we are actually generating a SVG file.
1 parent 27b2d2e commit b2282bb

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Generate coverage report
4040
run: |
4141
lcov --capture --directory build --output-file coverage.info
42-
lcov --remove coverage.info '/usr/*' --output-file coverage.info
42+
lcov --ignore-errors unused --remove coverage.info '/usr/*' --output-file coverage.info
4343
genhtml coverage.info --output-directory docs/coverage --title "yafl Code Coverage"
4444
4545
- name: Generate coverage badge
@@ -128,7 +128,15 @@ jobs:
128128
"@
129129
130130
New-Item -ItemType Directory -Force -Path docs
131-
Set-Content -Path "docs/coverage_windows_${{ matrix.arch }}.svg" -Value $svg
131+
$badgePath = "docs/coverage_windows_${{ matrix.arch }}.svg"
132+
Set-Content -Path $badgePath -Value $svg
133+
if (Test-Path $badgePath) {
134+
Write-Host "Badge created: $badgePath (${percentage}% coverage)"
135+
Get-Content $badgePath | Select-Object -First 5
136+
} else {
137+
Write-Error "Failed to create badge file"
138+
exit 1
139+
}
132140
133141
- name: Upload Coverage Report
134142
uses: actions/upload-artifact@v4
@@ -180,7 +188,7 @@ jobs:
180188
- name: Generate Coverage Report
181189
run: |
182190
lcov --gcov-tool llvm-gcov --capture --directory build --output-file coverage.info
183-
lcov --gcov-tool llvm-gcov --remove coverage.info '/usr/*' --output-file coverage.info
191+
lcov --gcov-tool llvm-gcov --ignore-errors unused --remove coverage.info '/usr/*' --output-file coverage.info
184192
genhtml coverage.info --output-directory docs/coverage --title "yafl Code Coverage"
185193
186194
- name: Generate Coverage Badge

0 commit comments

Comments
 (0)