|
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). |
8 | 2 | name: coverity-unified-runtime
|
9 |
| -# It runs static analysis build - Coverity. It requires special token (set in CI's secret). |
10 | 3 |
|
11 | 4 | on:
|
12 | 5 | workflow_dispatch:
|
13 | 6 | schedule:
|
14 | 7 | # Run every day at 22:00 UTC
|
15 | 8 | - cron: '0 22 * * *'
|
16 | 9 |
|
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 |
| - |
26 | 10 | permissions:
|
27 | 11 | contents: read
|
28 | 12 |
|
29 | 13 | jobs:
|
30 |
| - linux: |
| 14 | + coverity: |
31 | 15 | 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 |
33 | 19 |
|
34 | 20 | steps:
|
35 |
| - - name: Clone the git repo |
| 21 | + - name: Checkout repository |
36 | 22 | 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 |
37 | 32 |
|
38 | 33 | - name: Install pip packages
|
39 | 34 | run: pip install -r third_party/requirements.txt
|
40 | 35 |
|
| 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) |
41 | 45 | - name: Configure CMake
|
42 | 46 | run: >
|
43 | 47 | 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 |
45 | 52 | -DUR_ENABLE_TRACING=ON
|
46 |
| - -DUR_DEVELOPER_MODE=ON |
47 | 53 | -DUR_BUILD_TESTS=ON
|
48 |
| - -DUMF_ENABLE_POOL_TRACKING=ON |
49 |
| - -DUR_FORMAT_CPP_STYLE=ON |
50 |
| - -DCMAKE_BUILD_TYPE=Debug |
51 | 54 | -DUR_BUILD_ADAPTER_L0=ON
|
52 | 55 | -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 |
54 | 57 | -DUR_BUILD_ADAPTER_NATIVE_CPU=ON
|
55 |
| - -DUR_BUILD_ADAPTER_HIP=ON |
| 58 | + -DUR_BUILD_ADAPTER_HIP=OFF |
56 | 59 | -DUR_BUILD_ADAPTER_OPENCL=ON
|
57 | 60 |
|
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 |
59 | 73 | 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 |
0 commit comments