Coverity #3
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
| name: Coverity | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| description: | |
| description: 'Custom build description' | |
| required: true | |
| type: string | |
| default: 'Out-of-order Coverity scan' | |
| ref: | |
| description: 'Git ref to checkout and scan' | |
| required: true | |
| type: string | |
| default: 'sycl' | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| permissions: read-all | |
| jobs: | |
| coverity: | |
| if: github.repository == 'intel/llvm' | |
| name: Coverity | |
| runs-on: [Linux, build] | |
| container: | |
| image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps | |
| options: -u 1001:1001 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| sparse-checkout: | | |
| devops/actions | |
| - name: Register cleanup after job is finished | |
| uses: ./devops/actions/cleanup | |
| - uses: ./devops/actions/cached_checkout | |
| with: | |
| path: src | |
| ref: ${{ inputs.ref || github.sha }} | |
| cache_path: "/__w/repo_cache/" | |
| - name: Get coverity tool | |
| run: | | |
| wget https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=intel%2Fllvm" -O coverity_tool.tgz | |
| tar -xf coverity_tool.tgz | |
| - name: Configure | |
| env: | |
| CC: gcc | |
| CXX: g++ | |
| CUDA_LIB_PATH: "/usr/local/cuda/lib64/stubs" | |
| run: | | |
| mkdir -p $GITHUB_WORKSPACE/build | |
| cd $GITHUB_WORKSPACE/build | |
| python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ | |
| -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \ | |
| --ci-defaults --use-zstd --hip --cuda \ | |
| -DNATIVECPU_USE_OCK=Off | |
| - name: Build with coverity | |
| run: $GITHUB_WORKSPACE/cov-analysis-linux64-*/bin/cov-build --dir cov-int cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain | |
| - name: Compress results | |
| run: tar -I pigz -cf intel_llvm.tgz cov-int | |
| - name: Submit build | |
| run: | | |
| default_description="${{ inputs.description }}" | |
| if [[ -z $default_description ]]; then | |
| default_description="Regular build" | |
| fi | |
| # Initialize a build. Fetch a cloud upload url. | |
| curl -X POST \ | |
| -d version="${{ inputs.ref || github.sha }}" \ | |
| -d description="$default_description" \ | |
| -d email=${{ secrets.COVERITY_EMAIL }} \ | |
| -d token=${{ secrets.COVERITY_TOKEN }} \ | |
| -d file_name="intel_llvm.tgz" \ | |
| https://scan.coverity.com/projects/31090/builds/init \ | |
| | tee response | |
| # Store response data to use in later stages. | |
| upload_url=$(jq -r '.url' response) | |
| build_id=$(jq -r '.build_id' response) | |
| # Upload the tarball to the Cloud. | |
| curl -X PUT \ | |
| --header 'Content-Type: application/json' \ | |
| --upload-file $PWD/intel_llvm.tgz \ | |
| $upload_url | |
| # Trigger the build on Scan. | |
| curl -X PUT \ | |
| -d token=${{ secrets.COVERITY_TOKEN }} \ | |
| https://scan.coverity.com/projects/31090/builds/$build_id/enqueue |