79
79
INSTALL_DIR : ${{ github.workspace }}/install
80
80
BUILD_DIR : ${{ github.workspace }}/build
81
81
BUILD_TYPE : Release
82
+ COV_TOOL_DIR : ${{ github.workspace }}/coverity_tool
82
83
83
84
steps :
84
85
- name : Clone openvino.genai
@@ -92,36 +93,45 @@ jobs:
92
93
name : ${{ needs.openvino_download.outputs.ov_artifact_name }}
93
94
path : ${{ env.OV_INSTALL_DIR }}
94
95
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 }}
95
105
96
106
- name : Download coverity tool
107
+ if : github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
97
108
run : |
98
109
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
+
103
112
- name : Create config file for coverity build
104
113
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
107
116
108
117
- name : Create build.sh
109
118
run : |
110
119
echo """
111
120
mkdir -p ${{ github.workspace }}/build
112
121
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)
114
123
""" > build.sh
115
124
116
125
- name : Build for coverity
117
126
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
119
128
120
129
- name : Pack for analysis submission
121
130
run : tar -cvf - cov-int | pigz > openvino-genai.tgz
122
131
working-directory : ${{ env.BUILD_DIR }}
123
132
124
133
- name : Submit to coverity
134
+ if : github.event_name == 'schedule'
125
135
run : |
126
136
apt-get update && apt-get install -y curl jq
127
137
pushd ${BUILD_DIR}
@@ -147,8 +157,15 @@ jobs:
147
157
148
158
- name : Show Coverity configure logs
149
159
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
151
161
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
+
152
169
- name : Upload Coverity build log
153
170
uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
154
171
if : always()
0 commit comments