-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Microsoft C++ Code Analysis | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
# Path to the CMake build directory. | ||
build: '${{ github.workspace }}/build' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup | ||
run: | | ||
$Url = "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/binaries/boost_1_75_0-msvc-14.2-64.exe" | ||
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe") | ||
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=C:\local\boost-1.75.0" | ||
- name: Configure CMake | ||
env: | ||
BOOST_ROOT: C:\local\boost-1.75.0 | ||
run: cmake -B ${{ env.build }} -DQL_USE_STD_CLASSES=ON | ||
|
||
- name: Initialize MSVC Code Analysis | ||
uses: microsoft/[email protected] | ||
# Provide a unique ID to access the sarif output path | ||
id: run-analysis | ||
env: | ||
CAExcludePath: C:\local\boost-1.75.0 | ||
with: | ||
cmakeBuildDirectory: ${{ env.build }} | ||
buildConfiguration: Release | ||
ruleset: '${{ github.workspace }}/.msvc-analysis.ruleset' | ||
|
||
- name: Upload SARIF to GitHub | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: ${{ steps.run-analysis.outputs.sarif }} | ||
|
||
- name: Upload SARIF as an Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: sarif-file | ||
path: ${{ steps.run-analysis.outputs.sarif }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RuleSet Name="Example" Description="Enable Warnings" ToolsVersion="10.0"> | ||
<!-- Default rules available in Visual Studio --> | ||
<Include Path="NativeRecommendedRules.ruleset" Action="Default" /> | ||
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native"> | ||
<Rule Id="C26495" Action="None" /> <!-- Uninitialized members: too many --> | ||
<Rule Id="C26451" Action="None" /> <!-- Arithmetic overflow: too many --> | ||
</Rules> | ||
</RuleSet> |