Skip to content

Commit ca69634

Browse files
authored
Merge pull request #2317 from lukaszstolarczuk/update-coverity
[CI] Move coverity job to public GHA runner
2 parents 3e17b04 + 7251d1a commit ca69634

File tree

3 files changed

+52
-60
lines changed

3 files changed

+52
-60
lines changed

.github/scripts/0001-travis-fix-travisci_build_coverity_scan.sh.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/coverity.yml

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,81 @@
1-
#
2-
# Copyright (C) 2023-2024 Intel Corporation
3-
#
4-
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
5-
# See LICENSE.TXT
6-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7-
#
1+
# Coverity - static analysis build. It requires Coverity's token (set in CI's secret).
82
name: coverity-unified-runtime
9-
# It runs static analysis build - Coverity. It requires special token (set in CI's secret).
103

114
on:
125
workflow_dispatch:
136
schedule:
147
# Run every day at 22:00 UTC
158
- cron: '0 22 * * *'
169

17-
env:
18-
WORKDIR: ${{ github.workspace }}
19-
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
20-
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
21-
COVERITY_SCAN_PROJECT_NAME: ${{ github.repository }}
22-
COVERITY_SCAN_BUILD_COMMAND: "cmake --build ${{github.workspace}}/build"
23-
COVERITY_SCAN_BRANCH_PATTERN: "main"
24-
TRAVIS_BRANCH: ${{ github.ref_name }}
25-
2610
permissions:
2711
contents: read
2812

2913
jobs:
30-
linux:
14+
coverity:
3115
name: Coverity
32-
runs-on: coverity
16+
# run only on upstream; forks don't have token for upstream's cov project
17+
if: github.repository == 'oneapi-src/unified-memory-framework'
18+
runs-on: ubuntu-latest
3319

3420
steps:
35-
- name: Clone the git repo
21+
- name: Checkout repository
3622
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Install dependencies
27+
run: |
28+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
29+
sudo dpkg -i cuda-keyring_1.1-1_all.deb
30+
sudo apt-get update
31+
sudo apt-get install -y libhwloc-dev libtbb-dev cuda-toolkit-12-6
3732
3833
- name: Install pip packages
3934
run: pip install -r third_party/requirements.txt
4035

36+
- name: Download Coverity
37+
run: |
38+
wget -O coverity_tool.tgz -nv https://scan.coverity.com/download/linux64 \
39+
--post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=oneapi-src%2Funified-runtime"
40+
41+
- name: Extract Coverity
42+
run: tar xzf coverity_tool.tgz
43+
44+
# TODO: enable HIP adapter as well (requires proper package(s) installation)
4145
- name: Configure CMake
4246
run: >
4347
cmake
44-
-B $WORKDIR/build
48+
-B ${{github.workspace}}/build
49+
-DCMAKE_BUILD_TYPE=Release
50+
-DUR_DEVELOPER_MODE=OFF
51+
-DUR_FORMAT_CPP_STYLE=ON
4552
-DUR_ENABLE_TRACING=ON
46-
-DUR_DEVELOPER_MODE=ON
4753
-DUR_BUILD_TESTS=ON
48-
-DUMF_ENABLE_POOL_TRACKING=ON
49-
-DUR_FORMAT_CPP_STYLE=ON
50-
-DCMAKE_BUILD_TYPE=Debug
5154
-DUR_BUILD_ADAPTER_L0=ON
5255
-DUR_BUILD_ADAPTER_CUDA=ON
53-
-DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so
56+
-DCUDA_CUDA_LIBRARY=/usr/local/cuda-12.6/targets/x86_64-linux/lib/stubs/libcuda.so
5457
-DUR_BUILD_ADAPTER_NATIVE_CPU=ON
55-
-DUR_BUILD_ADAPTER_HIP=ON
58+
-DUR_BUILD_ADAPTER_HIP=OFF
5659
-DUR_BUILD_ADAPTER_OPENCL=ON
5760
58-
- name: Run Coverity
61+
- name: Build
62+
run: |
63+
export COVERITY_DIR=$(find . -maxdepth 1 -type d -name "cov-analysis-linux64-*" | head -n 1)
64+
if [ -n "$COVERITY_DIR" ]; then
65+
export PATH="$PATH:$COVERITY_DIR/bin"
66+
fi
67+
cov-build --dir ${{github.workspace}}/coverity-files cmake --build ${{github.workspace}}/build --config Release -j$(nproc)
68+
69+
- name: Create tarball to analyze
70+
run: tar czvf ur-coverity-files.tgz coverity-files
71+
72+
- name: Push tarball to scan
5973
run: |
60-
cd $WORKDIR/build
61-
wget https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh
62-
patch < "../.github/scripts/0001-travis-fix-travisci_build_coverity_scan.sh.patch"
63-
bash ./travisci_build_coverity_scan.sh
74+
BRANCH_NAME=$(echo ${GITHUB_REF_NAME})
75+
COMMIT_ID=$(echo $GITHUB_SHA)
76+
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
77+
--form email=bb-ur@intel.com \
78+
--form file=@ur-coverity-files.tgz \
79+
--form version="$COMMIT_ID" \
80+
--form description="$BRANCH_NAME:$COMMIT_ID" \
81+
https://scan.coverity.com/builds\?project\=oneapi-src%2Funified-runtime

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
[![Build and test](https://github.com/oneapi-src/unified-runtime/actions/workflows/cmake.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/cmake.yml)
44
[![Bandit](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml)
55
[![CodeQL](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml)
6-
[![Coverity](https://scan.coverity.com/projects/28213/badge.svg)](https://scan.coverity.com/projects/oneapi-src-unified-runtime)
6+
[![Coverity build](https://github.com/oneapi-src/unified-runtime/actions/workflows/coverity.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-runtime/actions/workflows/coverity.yml)
7+
[![Coverity report](https://scan.coverity.com/projects/28213/badge.svg)](https://scan.coverity.com/projects/oneapi-src-unified-runtime)
78
[![Nightly](https://github.com/oneapi-src/unified-runtime/actions/workflows/nightly.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/nightly.yml)
89
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/oneapi-src/unified-runtime/badge)](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/unified-runtime)
910
[![Trivy](https://github.com/oneapi-src/unified-runtime/actions/workflows/trivy.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/trivy.yml)

0 commit comments

Comments
 (0)