Skip to content

Commit 9ba3e8f

Browse files
committed
[CI] Add Coverity build
Signed-off-by: Krzysztof Filipek <[email protected]>
1 parent c860b3a commit 9ba3e8f

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/coverity.yml

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

0 commit comments

Comments
 (0)