-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added MSVC analysis to project Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com> * Ignoring autogenerated files Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com> * Disabled build testing and examples for msvc code analysis Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com> * Added new step in code analysis for MSVC Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
- Loading branch information
1 parent
c4a8d62
commit e7d0edb
Showing
2 changed files
with
90 additions
and
69 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,90 @@ | ||
# This workflow is based on the examples from the default CodeQL and MSVC Code Analysis | ||
# workflow templates. | ||
# | ||
name: "CodeQL/MSVC Code Analysis" | ||
|
||
on: | ||
push: | ||
branches: [ development ] | ||
pull_request: | ||
branches: [ development ] | ||
schedule: | ||
- cron: '28 10 * * 0' | ||
|
||
jobs: | ||
analyze_codeql: | ||
name: Analyze (CodeQL) | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'cpp' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
analyze_msvc: | ||
name: Analyze (MSVC Code Analysis) | ||
runs-on: windows-latest | ||
env: | ||
build: '${{ github.workspace }}/build' | ||
config: 'Debug' | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'cpp' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
# We won't do the analysis on any test-related code (test bundles, unittest files, etc.) | ||
- name: Configure with CMake | ||
run: cmake -B ${{ env.build }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DUS_ENABLE_THREADING_SUPPORT=ON | ||
|
||
# Because certain files are auto-generated during the build, we need to build | ||
- name: Build with CMake | ||
run: cmake --build ${{ env.build }} --config ${{ env.config }} | ||
|
||
- name: Run MSVC Code Analysis | ||
uses: microsoft/msvc-code-analysis-action@v0.1.0 | ||
# Provide a unique ID to access the sarif output path | ||
id: run-msvc-analysis | ||
with: | ||
cmakeBuildDirectory: ${{ env.build }} | ||
buildConfiguration: ${{ env.config }} | ||
# Ruleset file that will determine what checks will be run | ||
ruleset: NativeRecommendedRules.ruleset | ||
# Paths to ignore analysis of CMake targets and includes | ||
#ignoredPaths: ${{ github.workspace }}/build/framework/test/bundles;${{ github.workspace }}/build/compendium/test_bundles | ||
|
||
# Upload SARIF file to GitHub Code Scanning Alerts | ||
- name: Upload SARIF to GitHub | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: ${{ steps.run-msvc-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-msvc-analysis.outputs.sarif }} |
This file was deleted.
Oops, something went wrong.