Skip to content

[CI] Add Coverity scan #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Coverity check
name: Coverity

on:
workflow_dispatch:
inputs:
cov_push_tarball:
description: 'Send Coverity tarball'
required: true
default: 'true'
type: boolean
schedule:
- cron: '0 0 * * *'

jobs:
coverity:
name: Coverity
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y cmake hwloc libhwloc-dev libjemalloc-dev libnuma-dev libtbb-dev

- name: Download Coverity
run: |
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

- name: Extract Coverity
run: |
tar xzf coverity_tool.tgz

- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Release
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=OFF
-DUMF_ENABLE_POOL_TRACKING=ON
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON

- name: Build
run: |
export COVERITY_DIR=$(find . -maxdepth 1 -type d -name "cov-analysis-linux64-*" | head -n 1)
if [ -n "$COVERITY_DIR" ]; then
export PATH="$PATH:$COVERITY_DIR/bin"
fi
cov-build --dir ${{github.workspace}}/cov-int cmake --build ${{github.workspace}}/build --config Release -j$(nproc)

- name: Create tarball to analyze
run: >
tar czvf cov-int_umf.tgz cov-int

- name: Push to Coverity Scan
if: ${{ github.event.inputs.cov_push_tarball == 'true' }}
run: |
BRANCH_NAME=$(echo ${GITHUB_REF_NAME})
COMMIT_ID=$(echo $GITHUB_SHA)
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
--form [email protected] \
--form file=@cov-int_umf.tgz \
--form version="$COMMIT_ID" \
--form description="$BRANCH_NAME:$COMMIT_ID" \
https://scan.coverity.com/builds\?project\=oneapi-src%2Funified-memory-framework
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![Benchmarks](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/benchmarks.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/benchmarks.yml)
[![Nightly](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/nightly.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/nightly.yml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/oneapi-src/unified-memory-framework/badge)](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/unified-memory-framework)
[![Coverity](https://scan.coverity.com/projects/29761/badge.svg?flat=0)](https://scan.coverity.com/projects/oneapi-src-unified-memory-framework)

## Introduction

Expand Down