forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
187 lines (157 loc) · 7.2 KB
/
coverage.yml
File metadata and controls
187 lines (157 loc) · 7.2 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
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
name: Code coverage
on: workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
Coverage:
runs-on: ${{ matrix.config.os }}
env:
CMAKE_BUILD_TYPE: 'Release'
strategy:
fail-fast: false
matrix:
config:
- { name: "Ubuntu-gcc", os: ubuntu-latest-16-cores, cc: "gcc", cxx: "g++" }
steps:
- name: Setup python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.10.10'
architecture: 'x64'
- name: Setup ccache
uses: hendrikmuhs/ccache-action@5ebbd400eff9e74630f759d94ddd7b6c26299639 # v1.2.20
with:
max-size: 50G
- name: Clone OpenVINO
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
with:
submodules: 'true'
- name: Install dependencies
run: |
sudo apt --assume-yes update
sudo -E ${{ github.workspace }}/install_build_dependencies.sh
sudo apt --assume-yes install lcov
python3 -m pip install --upgrade pip
python3 -m pip install -r ${{ github.workspace }}/src/bindings/python/wheel/requirements-dev.txt
# For running Paddle frontend unit tests
python3 -m pip install -r ${{ github.workspace }}/src/frontends/paddle/tests/requirements.txt
# For running ONNX frontend unit tests
python3 -m pip install -r ${{ github.workspace }}/src/frontends/onnx/tests/requirements.txt
# For running TensorFlow frontend unit tests
python3 -m pip install -r ${{ github.workspace }}/src/frontends/tensorflow/tests/requirements.txt
- name: Build OpenVINO with CMake
uses: ashutoshvarma/action-cmake-build@ade188313bc7eaa6f14349569a64d8bc716342ff # master
with:
build-dir: ${{ github.workspace }}/build
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
configure-options: >
-GNinja
-DCMAKE_VERBOSE_MAKEFILE=ON
-DENABLE_PYTHON=ON
-DENABLE_ONEDNN_FOR_GPU=ON
-DENABLE_TESTS=ON
-DENABLE_OV_ONNX_FRONTEND=ON
-DENABLE_STRICT_DEPENDENCIES=OFF
-DENABLE_COVERAGE=ON
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_LINKER_LAUNCHER=ccache
-DCMAKE_CXX_LINKER_LAUNCHER=ccache
-DENABLE_SYSTEM_SNAPPY=ON
build-type: ${{ env.CMAKE_BUILD_TYPE }}
- name: Install wheel packages
run: cmake -DCOMPONENT=python_wheels -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install_pkg -P '${{ github.workspace }}/build/cmake_install.cmake'
- name: List binaries
run: ls -la ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}
- name: Install OpenVINO
run: cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install_pkg -P '${{ github.workspace }}/build/cmake_install.cmake'
- name: Run OV core unit tests
run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_core_unit_tests
continue-on-error: true
- name: Run OV Proxy plugin tests
run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_proxy_plugin_tests
continue-on-error: true
- name: Run OV Hetero Func tests
run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_hetero_func_tests --gtest_filter="*smoke*" --gtest_filter=-"nightly*"
continue-on-error: true
- name: Run IR frontend tests
run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_ir_frontend_tests
continue-on-error: true
- name: Run ONNX frontend tests
run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_onnx_frontend_tests --gtest_filter=-*IE_GPU*
continue-on-error: true
# - name: Run Paddle frontend unit tests
# run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/paddle_tests --gtest_filter=-*IE_GPU*
# continue-on-error: true
- name: Run TensorFlow frontend unit tests
run: ${{ github.workspace }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_tensorflow_frontend_tests --gtest_filter=-*IE_GPU*
continue-on-error: true
- name: Print info
run: |
ls -laR
pwd
- name: Generate raport
run: |
set -euo pipefail
SRC_DIR="${{ github.workspace }}"
BUILD_DIR="${{ github.workspace }}/build"
REPORT_DIR="${{ github.workspace }}/coverage-report"
echo "Capturing coverage from $BUILD_DIR (base=$SRC_DIR)..."
lcov --capture \
--directory "$BUILD_DIR" \
--base-directory "$SRC_DIR" \
--output-file coverage.info \
--no-external \
--rc geninfo_unexecuted_blocks=1 \
--ignore-errors mismatch,negative,unused
echo "Applying exclude patterns (tests, thirdparty, protobuf generated)..."
lcov --remove coverage.info \
"${SRC_DIR}/*.pb.cc" \
"${SRC_DIR}/*.pb.h" \
"${SRC_DIR}/*/tests/*" \
"${SRC_DIR}/thirdparty/*" \
-o coverage.info
mkdir -p "$REPORT_DIR"
genhtml coverage.info \
--output-directory "$REPORT_DIR" \
--prefix "$SRC_DIR" \
--synthesize-missing
- name: Coverage summary
run: |
echo "## Code coverage (lcov)" >> "$GITHUB_STEP_SUMMARY"
if [ -f coverage.info ]; then
echo "" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
lcov --summary coverage.info >> "$GITHUB_STEP_SUMMARY" || true
echo '```' >> "$GITHUB_STEP_SUMMARY"
else
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "coverage.info not found (coverage generation likely failed earlier)." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Package coverage report
run: |
set -euo pipefail
if [ -d "${{ github.workspace }}/coverage-report" ] && [ -f coverage.info ]; then
tar -czf coverage-report.tgz coverage-report coverage.info
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Artifact: \`coverage-report.tgz\` (download from Actions → Artifacts, then extract and open \`coverage-report/index.html\`)." >> "$GITHUB_STEP_SUMMARY"
else
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "coverage-report/ or coverage.info missing → skipping artifact packaging." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload coverage artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: coverage-report-${{ matrix.config.name }}
path: coverage-report.tgz
if-no-files-found: warn
retention-days: 30
compression-level: 0
- name: Collect coverage
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
verbose: true