Skip to content

Try to get json creation to work. #59

Try to get json creation to work.

Try to get json creation to work. #59

name: CMake on a single platform
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Install Ninja
run: choco install ninja
- name: Install PVS-Studio
run: choco install pvs-studio --package-parameters="'/standalone'"
shell: cmd
- name: PVS-Setup License
run: :"c:\Program Files (x86)\PVS-Studio\PVS-Studio_Cmd.exe" \
--userName ${{ secrets.USER_NAME }} --licenseKey ${{ secrets.LICSESE_KEY }}
shell: cmd
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja .
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Create compile_commands.json
working-directory: ${{github.workspace}}/build
run: ninja -t compdb > compile_commands.json
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Run Analysis
run: :"c:\Program Files (x86)\PVS-Studio\CompilerCommandsAnalyzer.exe" analyze -f
build/compile_commands.json -j
shell: cmd
- name: Convert Report
run: :"c:\Program Files (x86)\PVS-Studio\PlogConverter.exe" -a GA:1,2 -t Sarif \
-o pvs-report.sarif PVS-Studio.log
shell: cmd
- name: Publish report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: pvs-report.sarif
category: PVS-Studio