Skip to content

Microsoft C++ Code Analysis #340

Microsoft C++ Code Analysis

Microsoft C++ Code Analysis #340

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# Find more information at:
# https://github.com/microsoft/msvc-code-analysis-action
name: Microsoft C++ Code Analysis
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
branches: [main]
schedule:
- cron: '36 2 * * 3'
env:
# Path to the CMake build directory.
build_dir: '${{ github.workspace }}/build'
configuration: 'Debug'
jobs:
Analyze:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
show-progress: false
- name: Configure CMake
run: cmake -S src -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.configuration }}
# Build is not required unless generated source files are used
# - name: Build CMake
# run: cmake --build ${{ env.build_dir }} --config ${{ env.configuration }}
- name: Run MSVC Code Analysis
uses: microsoft/[email protected]
# Provide a unique ID to access the sarif output path
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build_dir }}
buildConfiguration: ${{ env.configuration }}
# Ruleset file that will determine what checks will be run
ruleset: NativeRecommendedRules.ruleset
ignoredPaths: src/external/gsl;src/external/tinyxml2
# 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 }}
# Upload SARIF file as an Artifact to download and view
# - name: Upload SARIF as an Artifact
# uses: actions/upload-artifact@v2
# with:
# name: sarif-file
# path: ${{ steps.run-analysis.outputs.sarif }}