Skip to content

Commit 0a9c20d

Browse files
committed
[CI] Add Coverity build
Signed-off-by: Krzysztof Filipek <[email protected]>
1 parent de4cce7 commit 0a9c20d

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/coverity.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Coverity check
2+
name: Coverity
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
cov_push_tarball:
8+
description: 'Send Coverity tarball'
9+
required: true
10+
default: 'true'
11+
type: boolean
12+
schedule:
13+
- cron: '0 0 * * *'
14+
15+
jobs:
16+
coverity:
17+
name: Coverity
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
22+
23+
- name: Install apt packages
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y cmake hwloc libhwloc-dev libjemalloc-dev libnuma-dev libtbb-dev
27+
28+
- name: Download Coverity
29+
run: |
30+
wget -nv https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=oneapi-src%2Funified-memory-framework" -O coverity_tool.tgz
31+
32+
- name: Extract Coverity
33+
run: |
34+
tar xzf coverity_tool.tgz
35+
36+
- name: Configure CMake
37+
run: >
38+
cmake
39+
-B ${{github.workspace}}/build
40+
-DCMAKE_BUILD_TYPE=Release
41+
-DUMF_FORMAT_CODE_STYLE=OFF
42+
-DUMF_DEVELOPER_MODE=OFF
43+
-DUMF_ENABLE_POOL_TRACKING=ON
44+
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
45+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
46+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
47+
48+
- name: Build
49+
run: |
50+
export COVERITY_DIR=$(find . -maxdepth 1 -type d -name "cov-analysis-linux64-*" | head -n 1)
51+
if [ -n "$COVERITY_DIR" ]; then
52+
export PATH="$PATH:$COVERITY_DIR/bin"
53+
fi
54+
cov-build --dir ${{github.workspace}}/cov-int cmake --build ${{github.workspace}}/build --config Release -j$(nproc)
55+
56+
- name: Create tarball to analyze
57+
run: >
58+
tar czvf cov-int_umf.tgz cov-int
59+
60+
- name: Push to Coverity Scan
61+
if: ${{ github.event.inputs.cov_push_tarball == 'true' }}
62+
run: |
63+
BRANCH_NAME=$(echo ${GITHUB_REF_NAME})
64+
COMMIT_ID=$(echo $GITHUB_SHA)
65+
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
66+
67+
--form file=@cov-int_umf.tgz \
68+
--form version="$COMMIT_ID" \
69+
--form description="$BRANCH_NAME:$COMMIT_ID" \
70+
https://scan.coverity.com/builds\?project\=oneapi-src%2Funified-memory-framework

0 commit comments

Comments
 (0)