Skip to content

Commit 9c936a6

Browse files
authored
Create msvc.yml
1 parent d8b9497 commit 9c936a6

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/msvc.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
#
6+
# Find more information at:
7+
# https://github.com/microsoft/msvc-code-analysis-action
8+
9+
name: Microsoft C++ Code Analysis
10+
11+
on:
12+
push:
13+
branches: [ "main" ]
14+
pull_request:
15+
branches: [ "main" ]
16+
schedule:
17+
- cron: '28 15 * * 3'
18+
19+
env:
20+
# Path to the CMake build directory.
21+
build: '${{ github.workspace }}/build'
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
analyze:
28+
permissions:
29+
contents: read # for actions/checkout to fetch code
30+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
31+
name: Analyze
32+
runs-on: windows-latest
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v3
37+
38+
- name: Configure CMake
39+
run: cmake -B ${{ env.build }}
40+
41+
# Build is not required unless generated source files are used
42+
# - name: Build CMake
43+
# run: cmake --build ${{ env.build }}
44+
45+
- name: Initialize MSVC Code Analysis
46+
uses: microsoft/msvc-code-analysis-action@04825f6d9e00f87422d6bf04e1a38b1f3ed60d99
47+
# Provide a unique ID to access the sarif output path
48+
id: run-analysis
49+
with:
50+
cmakeBuildDirectory: ${{ env.build }}
51+
# Ruleset file that will determine what checks will be run
52+
ruleset: NativeRecommendedRules.ruleset
53+
54+
# Upload SARIF file to GitHub Code Scanning Alerts
55+
- name: Upload SARIF to GitHub
56+
uses: github/codeql-action/upload-sarif@v2
57+
with:
58+
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
59+
60+
# Upload SARIF file as an Artifact to download and view
61+
# - name: Upload SARIF as an Artifact
62+
# uses: actions/upload-artifact@v3
63+
# with:
64+
# name: sarif-file
65+
# path: ${{ steps.run-analysis.outputs.sarif }}

0 commit comments

Comments
 (0)