Coverity #476
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Coverity - static analysis build. It requires Coverity's token (set in CI's secret). | |
name: Coverity | |
on: | |
workflow_dispatch: | |
inputs: | |
cov_push_tarball: | |
description: 'Send Coverity tarball' | |
required: true | |
default: true | |
type: boolean | |
schedule: | |
- cron: '0 0 * * *' | |
permissions: | |
contents: read | |
jobs: | |
coverity: | |
name: Coverity | |
# run only on upstream; forks don't have token for upstream's cov project | |
if: github.repository == 'oneapi-src/unified-memory-framework' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev | |
- name: Download Coverity | |
run: > | |
wget | |
-O coverity_tool.tgz | |
-nv https://scan.coverity.com/download/linux64 | |
--post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=oneapi-src%2Funified-memory-framework" | |
- 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_TESTS_FAIL_ON_SKIP=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_name == 'schedule' || 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=sys_bb-umf@intel.com \ | |
--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 |