-
Notifications
You must be signed in to change notification settings - Fork 7
63 lines (51 loc) · 1.82 KB
/
coverage.yml
File metadata and controls
63 lines (51 loc) · 1.82 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
name: Test Coverage
on: [pull_request, workflow_dispatch]
jobs:
build:
name: Report Test Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Install vcpkg (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: |
git clone https://github.com/microsoft/vcpkg.git "$HOME/vcpkg"
"$HOME/vcpkg/bootstrap-vcpkg.sh" -disableMetrics
echo "VCPKG_ROOT=$HOME/vcpkg" >> "$GITHUB_ENV"
echo "$HOME/vcpkg" >> "$GITHUB_PATH"
- name: Install vcpkg (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
git clone https://github.com/microsoft/vcpkg.git "$env:USERPROFILE\vcpkg"
& "$env:USERPROFILE\vcpkg\bootstrap-vcpkg.bat" -disableMetrics
echo "VCPKG_ROOT=$env:USERPROFILE\vcpkg" >> $env:GITHUB_ENV
echo "$env:USERPROFILE\vcpkg" >> $env:GITHUB_PATH
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake -DENABLE_COVERAGE=ON ..
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build .
- name: Prepare coverage data
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --target cov_data
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v4
with:
coverage-files: build/cov.info.cleaned
minimum-coverage: 30
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{github.workspace}}
update-comment: true