Skip to content

Coverity Scan

Coverity Scan #8

Workflow file for this run

# Copyright (c) 2026 Lukasz Stalmirski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: Coverity Scan
on:
workflow_dispatch:
# schedule:
# - cron: '00 09 * * 6'
jobs:
build:
runs-on: windows-latest
permissions:
contents: read
actions: read
security-events: write
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip'
- run: |
python3 -m pip install `
-r '${{ github.workspace }}/VkLayer_profiler_layer/scripts/requirements.txt'
- name: Get Coverity Build Tools
id: get-coverity
run: |
$request = @{
Uri = 'https://scan.coverity.com/download/cxx/win64'
Method = 'POST'
Body = @{
token = '${{ secrets.COVERITY_PASSPHRASE }}'
project = '${{ github.repository }}'
}
}
Invoke-WebRequest @request -OutFile cov_build_tools.zip
Expand-Archive cov_build_tools.zip
$cov_build_exe = (Get-ChildItem -Recurse "cov_build_tools/*/cov-build.exe").FullName
if (-Not $cov_build_exe) {
Write-Error "Coverity build tool not found."
exit 1
}
echo "cov_build_exe=$cov_build_exe" >> $env:GITHUB_OUTPUT
- name: Configure CMake
id: configure
run: |
$source_dir = '${{ github.workspace }}'
$build_dir = '${{ github.workspace }}/build'
cmake -S $source_dir -B $build_dir
echo "source_dir=$source_dir" >> $env:GITHUB_OUTPUT
echo "build_dir=$build_dir" >> $env:GITHUB_OUTPUT
- name: Build
run: |
${{ steps.get-coverity.outputs.cov_build_exe }} `
--dir cov-int `
cmake --build ${{ steps.configure.outputs.build_dir }} `
--config Release -j
- name: Package
id: package
run: |
$profiler_version = (python3 '${{ github.workspace }}/VkLayer_profiler_layer/scripts/gen_version.py')
if (-Not $profiler_version) {
Write-Error "Profiler version not found."
exit 1
}
$profiler_build_zip = "$($profiler_version).zip"
Compress-Archive cov-int -DestinationPath $profiler_build_zip
echo "profiler_version=$profiler_version" >> $env:GITHUB_OUTPUT
echo "profiler_build_zip=$profiler_build_zip" >> $env:GITHUB_OUTPUT
- uses: actions/upload-artifact@v7
with:
path: ${{ steps.package.outputs.profiler_build_zip }}
archive: false
- name: Submit
run: |
$project_name = [uri]::EscapeDataString("${{ github.repository }}")
$project_uri = "https://scan.coverity.com/builds?project=$project_name"
$form = @{
token = '${{ secrets.COVERITY_PASSPHRASE }}'
email = '${{ secrets.COVERITY_USER }}'
file = Get-Item -Path '${{ steps.package.outputs.profiler_build_zip }}'
version = '${{ steps.package.outputs.profiler_version }}'
}
#Invoke-WebRequest -Uri $project_uri -Method Post -Form $form