Skip to content

Commit fb41926

Browse files
committed
Where is OpenCppCoverage actually being installed? Try to find it dynamically.
1 parent d36c764 commit fb41926

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,14 @@ jobs:
8282

8383
- name: Generate Coverage Report
8484
run: |
85-
$env:PATH = "C:\Program Files (x86)\OpenCppCoverage;$env:PATH"
86-
OpenCppCoverage --sources "${{ github.workspace }}" --cover_children --export_type=html:build/coverage_report --export_type=cobertura:build/cobertura.xml -- ctest --test-dir build -C Debug --output-on-failure
85+
# Find OpenCppCoverage installation
86+
$opencppcoverage = Get-ChildItem -Path "C:\Program Files*" -Recurse -Filter "OpenCppCoverage.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
87+
if (-not $opencppcoverage) {
88+
Write-Error "OpenCppCoverage.exe not found"
89+
exit 1
90+
}
91+
Write-Host "Using OpenCppCoverage from: $($opencppcoverage.FullName)"
92+
& $opencppcoverage.FullName --sources "${{ github.workspace }}" --cover_children --export_type=html:build/coverage_report --export_type=cobertura:build/cobertura.xml -- ctest --test-dir build -C Debug --output-on-failure
8793
shell: pwsh
8894

8995
- name: Generate Coverage Badge

0 commit comments

Comments
 (0)