Skip to content

Commit

Permalink
Add /analyze to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Jul 26, 2024
1 parent f804f1c commit fd8cddb
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248929

name: Microsoft C++ Code Analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.yml
schedule:
- cron: '25 15 * * 5'

permissions:
contents: read

jobs:
analyze:
permissions:
contents: read
security-events: write
actions: read
name: Analyze
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure CMake
working-directory: ${{env.GITHUB_WORKSPACE}}
run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON

- name: Initialize MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@v0.1.1
id: run-analysis
with:
cmakeBuildDirectory: ./out
buildConfiguration: Debug
ruleset: NativeRecommendedRules.ruleset

# Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

0 comments on commit fd8cddb

Please sign in to comment.