Skip to content

Commit f7041bf

Browse files
Create msvc.yml
1 parent 9db0757 commit f7041bf

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/msvc.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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: [ "master" ]
14+
pull_request:
15+
branches: [ "master" ]
16+
schedule:
17+
- cron: '37 5 * * 4'
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+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
32+
name: Analyze
33+
runs-on: windows-latest
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
39+
- name: Run CUDA bash shell Windows
40+
env:
41+
temp: ${{ runner.temp }}
42+
cuda: ${{ matrix.cuda-version }}
43+
run: scripts/actions/install-cuda-windows.ps1
44+
shell: pwsh
45+
46+
47+
- name: Configure CMake
48+
run: cmake -B ${{ env.build }}
49+
50+
# Build is not required unless generated source files are used
51+
# - name: Build CMake
52+
# run: cmake --build ${{ env.build }}
53+
54+
- name: Initialize MSVC Code Analysis
55+
uses: microsoft/msvc-code-analysis-action@04825f6d9e00f87422d6bf04e1a38b1f3ed60d99
56+
# Provide a unique ID to access the sarif output path
57+
id: run-analysis
58+
with:
59+
cmakeBuildDirectory: ${{ env.build }}
60+
# Ruleset file that will determine what checks will be run
61+
ruleset: NativeRecommendedRules.ruleset
62+
63+
# Upload SARIF file to GitHub Code Scanning Alerts
64+
- name: Upload SARIF to GitHub
65+
uses: github/codeql-action/upload-sarif@v3
66+
with:
67+
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
68+
69+
# Upload SARIF file as an Artifact to download and view
70+
# - name: Upload SARIF as an Artifact
71+
# uses: actions/upload-artifact@v4
72+
# with:
73+
# name: sarif-file
74+
# path: ${{ steps.run-analysis.outputs.sarif }}

0 commit comments

Comments
 (0)