Skip to content

Commit 1e66375

Browse files
authored
[GHA] Coverity pipeline fixes (#2283)
- fixed build command line (-j causes memory consumption) - Improved coverity pipeline to test it without results analyzing
1 parent 662c6b9 commit 1e66375

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

.github/workflows/coverity.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
INSTALL_DIR: ${{ github.workspace }}/install
8080
BUILD_DIR: ${{ github.workspace }}/build
8181
BUILD_TYPE: Release
82+
COV_TOOL_DIR: ${{ github.workspace }}/coverity_tool
8283

8384
steps:
8485
- name: Clone openvino.genai
@@ -92,36 +93,45 @@ jobs:
9293
name: ${{ needs.openvino_download.outputs.ov_artifact_name }}
9394
path: ${{ env.OV_INSTALL_DIR }}
9495
merge-multiple: true
96+
97+
- name: Cache Coverity Tool
98+
if: github.event_name == 'pull_request'
99+
id: cache-coverity
100+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
101+
with:
102+
path: ${{ env.COV_TOOL_DIR }}
103+
key: coverity-${{ runner.os }}-${{ github.sha }}
104+
restore-keys: coverity-${{ runner.os }}
95105

96106
- name: Download coverity tool
107+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
97108
run: |
98109
wget -q https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SECRET_TOKEN }}&project=openvino.genai" -O coverity_tool.tgz
99-
tar -I pigz -xf coverity_tool.tgz
100-
echo "ENV_COV_TOOL_DIR=$(tar -tzf coverity_tool.tgz | head -1 | cut -f1 -d'/')" >> $GITHUB_ENV
101-
rm coverity_tool.tgz
102-
110+
pigz -dc coverity_tool.tgz | tar --strip-components=1 -xf - -C ${{ env.COV_TOOL_DIR }}
111+
103112
- name: Create config file for coverity build
104113
run: |
105-
${ENV_COV_TOOL_DIR}/bin/cov-configure --delete-compiler-config template-python-config-0
106-
${ENV_COV_TOOL_DIR}/bin/cov-configure --python --no-capture-config-files --version 3
114+
${{ env.COV_TOOL_DIR }}/bin/cov-configure --delete-compiler-config template-python-config-0
115+
${{ env.COV_TOOL_DIR }}/bin/cov-configure --python --no-capture-config-files --version 3
107116
108117
- name: Create build.sh
109118
run: |
110119
echo """
111120
mkdir -p ${{ github.workspace }}/build
112121
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_TOKENIZERS=NO -DOpenVINO_DIR=${OV_INSTALL_DIR}/runtime/cmake/ -DCMAKE_C_COMPILER_LAUNCHER= -DCMAKE_CXX_COMPILER_LAUNCHER= -B${BUILD_DIR} ${{ github.workspace }}/openvino.genai
113-
cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} -j
122+
cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} --parallel $(nproc)
114123
""" > build.sh
115124
116125
- name: Build for coverity
117126
run: |
118-
${ENV_COV_TOOL_DIR}/bin/cov-build --config ${ENV_COV_TOOL_DIR}/config/coverity_config.xml --tmpdir cov_temp --dir ${BUILD_DIR}/cov-int --fs-capture-search ./openvino.genai sh build.sh
127+
${{ env.COV_TOOL_DIR }}/bin/cov-build --config ${{ env.COV_TOOL_DIR }}/config/coverity_config.xml --tmpdir cov_temp --dir ${BUILD_DIR}/cov-int --fs-capture-search ./openvino.genai sh build.sh
119128
120129
- name: Pack for analysis submission
121130
run: tar -cvf - cov-int | pigz > openvino-genai.tgz
122131
working-directory: ${{ env.BUILD_DIR }}
123132

124133
- name: Submit to coverity
134+
if: github.event_name == 'schedule'
125135
run: |
126136
apt-get update && apt-get install -y curl jq
127137
pushd ${BUILD_DIR}
@@ -147,8 +157,15 @@ jobs:
147157
148158
- name: Show Coverity configure logs
149159
continue-on-error: true
150-
run: ${ENV_COV_TOOL_DIR}/bin/cov-configure -c ${ENV_COV_TOOL_DIR}/config/coverity_config.xml -lscc text
160+
run: ${{ env.COV_TOOL_DIR }}/bin/cov-configure -c ${{ env.COV_TOOL_DIR }}/config/coverity_config.xml -lscc text
151161

162+
- name: Save ccache
163+
if: always() && steps.cache-coverity.outputs.cache-hit != 'true'
164+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
165+
with:
166+
key: ${{ steps.cache-coverity.outputs.cache-primary-key }}
167+
path: ${{ env.CCACHE_DIR }}
168+
152169
- name: Upload Coverity build log
153170
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
154171
if: always()

0 commit comments

Comments
 (0)