Skip to content

Commit 503fdb2

Browse files
authored
Add Coverity scan (#1455)
* Add Coverity scan workflow and status badge
1 parent d6c0dfa commit 503fdb2

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/coverity.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright (c) 2024 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Coverity Scan
16+
17+
on:
18+
19+
# Only run on push to master branch
20+
push:
21+
branches: [master]
22+
23+
permissions: read-all
24+
25+
env:
26+
BUILD_CONCURRENCY: 4
27+
COVERITY_PROJECT: oneapi-src%2FoneTBB
28+
29+
jobs:
30+
coverity_linux:
31+
name: Coverity Linux
32+
runs-on: [ubuntu-latest]
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Download Linux 64 Coverity Tool
36+
run: |
37+
curl https://scan.coverity.com/download/cxx/linux64 --output ${GITHUB_WORKSPACE}/cov-linux64-tool.tar.gz \
38+
--data "token=${{secrets.COVERITY_TOKEN}}&project=${{env.COVERITY_PROJECT}}"
39+
mkdir cov-linux64-tool
40+
tar -xzf cov-linux64-tool.tar.gz --strip 1 -C cov-linux64-tool
41+
- name: Build with cov-build
42+
run: |
43+
export PATH="${PWD}/cov-linux64-tool/bin:${PATH}"
44+
mkdir build && cd build
45+
cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_BUILD_TYPE=relwithdebinfo \
46+
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DTBB_CPF=ON ..
47+
cov-build --dir cov-int make VERBOSE=1 -j${{env.BUILD_CONCURRENCY}}
48+
- name: Archive Coverity build results
49+
run: |
50+
cd build
51+
tar -czvf cov-int.tgz cov-int
52+
- name: Submit Coverity results for analysis
53+
run: |
54+
cd build
55+
curl \
56+
--form token="${{ secrets.COVERITY_TOKEN }}" \
57+
--form email="${{ secrets.COVERITY_EMAIL }}" \
58+
59+
--form version="${GITHUB_SHA}" \
60+
--form description="" \
61+
"https://scan.coverity.com/builds?project=${{env.COVERITY_PROJECT}}"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9125/badge)](https://www.bestpractices.dev/projects/9125)
55
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/uxlfoundation/oneTBB/badge)](https://securityscorecards.dev/viewer/?uri=github.com/uxlfoundation/oneTBB)
66
[![Gurubase](https://img.shields.io/badge/Gurubase-Ask%20oneTBB%20Guru-006BFF)](https://gurubase.io/g/onetbb)
7+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/oneapi-src/oneTBB/badge)](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/oneTBB)
8+
[![Coverity Scan Build Status](https://img.shields.io/coverity/scan/30373.svg)](https://scan.coverity.com/projects/oneapi-src-onetbb)
79

810
oneTBB is a flexible C++ library that simplifies the work of adding parallelism
911
to complex applications, even if you are not a threading expert.

0 commit comments

Comments
 (0)