1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
name: Microsoft C++ Code Analysis
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
env:
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
jobs:
analyze:
name: Analyze
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup
run: |
$Url = "https://archives.boost.io/release/1.89.0/source/boost_1_89_0.zip"
(New-Object System.Net.WebClient).DownloadFile($Url, "$RUNNER_TEMP\boost.zip")
Expand-Archive -Path "$RUNNER_TEMP\boost.zip" -DestinationPath C:\local
Rename-Item -Path "C:\local\boost_1_89_0" -NewName "boost"
- name: Configure CMake
env:
BOOST_ROOT: C:\local\boost
run: cmake -B ${{ env.build }} -DQL_USE_STD_CLASSES=ON
- name: Run MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@v0.1.1
# Provide a unique ID to access the sarif output path
id: run-analysis
env:
CAExcludePath: C:\local\boost
with:
cmakeBuildDirectory: ${{ env.build }}
buildConfiguration: Release
ruleset: '${{ github.workspace }}/.msvc-analysis.ruleset'
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
- name: Upload SARIF as an Artifact
uses: actions/upload-artifact@v4
with:
name: sarif-file
path: ${{ steps.run-analysis.outputs.sarif }}
|