-
Notifications
You must be signed in to change notification settings - Fork 15
130 lines (126 loc) · 4.15 KB
/
Copy pathcoverage.yml
File metadata and controls
130 lines (126 loc) · 4.15 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
name: Coverage
on:
push:
paths:
- "CMakeLists.txt"
- "codecov.yml"
- "**/workflows/coverage.yml"
- "**/cmake/**"
- "**/modules/**"
- "**/tests/**"
- "!**/native/generated/**"
- "!**/native/java*/**"
- "!**/native/*_android.*"
- "!**/native/*_apple.*"
- "!**/native/*_curl.*"
- "!**/native/*_emscripten.*"
- "!**/native/*_ios.*"
- "!**/native/*_mac.*"
- "!**/native/*_sdl2.*"
- "!**/native/*_wasm.*"
- "!**/native/*_windows.*"
branches:
- "**"
pull_request:
paths:
- "CMakeLists.txt"
- "codecov.yml"
- "**/workflows/coverage.yml"
- "**/cmake/**"
- "**/modules/**"
- "**/tests/**"
- "!**/native/generated/**"
- "!**/native/java*/**"
- "!**/native/*_android.*"
- "!**/native/*_apple.*"
- "!**/native/*_curl.*"
- "!**/native/*_emscripten.*"
- "!**/native/*_ios.*"
- "!**/native/*_mac.*"
- "!**/native/*_sdl2.*"
- "!**/native/*_wasm.*"
- "!**/native/*_windows.*"
branches:
- main
- "dev/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
INSTALL_DEPS: >-
libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev
libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev
libxrandr-dev libxrender-dev libglu1-mesa-dev libegl1-mesa-dev mesa-common-dev lcov
IGNORE_ERRORS: "mismatch,gcov,source,negative,unused,empty,format,corrupt"
jobs:
cpp-coverage:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Configure CMake with Coverage
run: |
cmake ${{ github.workspace }} -B ${{ runner.workspace }}/build \
-G "Ninja Multi-Config" \
-DYUP_BUILD_TESTS=ON \
-DYUP_BUILD_EXAMPLES=OFF \
-DYUP_ENABLE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=Debug
- name: Build Tests
working-directory: ${{ runner.workspace }}/build
run: cmake --build . --config Debug --target yup_tests
- name: Clean Coverage Data
working-directory: ${{ runner.workspace }}/build
run: cmake --build . --target coverage_clean
- name: Run C++ Tests
working-directory: ${{ runner.workspace }}/build/tests/Debug
run: ./yup_tests --gtest_output=xml:test_results.xml
- name: Generate C++ Coverage Report
working-directory: ${{ runner.workspace }}/build
run: |
mkdir -p coverage
lcov --directory . --capture --output-file coverage/coverage.info --ignore-errors ${IGNORE_ERRORS}
lcov --remove coverage/coverage.info \
"*/pybind11/*" \
"*/thirdparty/*" \
"*/build/*" \
"*/tests/*" \
"*/usr/*" \
"*/opt/*" \
"*/CMakeFiles/*" \
"*/native/*_android.*" \
"*/native/*_apple.*" \
"*/native/*_curl.*" \
"*/native/*_emscripten.*" \
"*/native/*_ios.*" \
"*/native/*_mac.*" \
"*/native/*_sdl2.*" \
"*/native/*_wasm.*" \
"*/native/*_windows.*" \
--output-file coverage/coverage_final.info --ignore-errors ${IGNORE_ERRORS}
lcov --list coverage/coverage_final.info
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ runner.workspace }}/build/coverage/coverage_final.info
name: overall-coverage
fail_ci_if_error: false
verbose: true
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: ${{ runner.workspace }}/build/tests/Debug/test_results.xml
- name: Upload Coverage Reports
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-reports
path: ${{ runner.workspace }}/build/coverage/