|
| 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}}" |
0 commit comments