separate log from build test results. #73
This file contains 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: 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.PVS_STUDIO_USER_NAME }} --licenseKey ${{ secrets.PVS_STUDIO_LICSESE_KEY }} | |
shell: cmd | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/testbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=On \ | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja . | |
- name: Build | |
run: cmake --build ${{github.workspace}}/testbuild --config ${{env.BUILD_TYPE}} | |
- name: Create compile_commands.json | |
working-directory: ${{github.workspace}}/testbuild | |
run: ninja -t compdb > compile_commands.json | |
- name: Test | |
working-directory: ${{github.workspace}}/testbuild | |
run: ctest -C ${{env.BUILD_TYPE}} | |
- name: Run Analysis | |
run: :"c:\Program Files (x86)\PVS-Studio\CompilerCommandsAnalyzer.exe" analyze -f \ | |
build/compile_commands.json -o ${{github.workspace}}/PVS_LOG/PVS-Studio.log -j | |
shell: cmd | |
- name: Convert Report | |
run: :"c:\Program Files (x86)\PVS-Studio\PlogConverter.exe" -a GA:1,2 -t Sarif \ | |
-o ${{github.workspace}}/PVS_LOG/pvs-report.sarif ${{github.workspace}}/PVS_LOG/PVS-Studio.log | |
shell: cmd | |
- name: Print Working dir | |
working-directory: ${{github.workspace}}/PVS_LOG | |
run: cd | |
shell: cmd | |
- name: List Files | |
working-directory: ${{github.workspace}}/PVS_LOG | |
run: dir | |
shell: cmd | |
- name: Publish report | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: ${{github.workspace}}/PVS_LOG/pvs-report.sarif | |
category: PVS-Studio |