-
Notifications
You must be signed in to change notification settings - Fork 109
56 lines (44 loc) · 1.65 KB
/
msvc.yml
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
55
56
name: Microsoft C++ Code Analysis
on: [ workflow_dispatch ]
permissions:
contents: read
jobs:
analyze:
env:
CONFIG_DIR: '${{ github.workspace }}/build'
permissions:
contents: read
security-events: write
name: ${{ matrix.target }} - ${{ matrix.cmake_configuration }}
runs-on: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
target: [ windows-latest ]
cmake_configuration: [ Debug, Release ]
steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -B ${{ env.CONFIG_DIR }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_configuration }} -G "Visual Studio 17 2022"
- name: Build CMake
run: cmake --build ${{ env.CONFIG_DIR }} --config ${{ matrix.cmake_configuration }}
- name: Initialize MSVC Code Analysis
uses: microsoft/[email protected]
# Provide a unique ID to access the sarif output path
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.CONFIG_DIR }}
buildConfiguration: '${{ matrix.cmake_configuration }}'
# Ruleset file that will determine what checks will be run
ruleset: CustomRules.ruleset
# Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
# Upload SARIF file as an Artifact to download and view
- name: Upload SARIF as an Artifact
uses: actions/upload-artifact@v3
with:
name: sarif-file
path: ${{ steps.run-analysis.outputs.sarif }}