3030
3131 # Initializes the CodeQL tools for scanning.
3232 - name : Initialize CodeQL
33- uses : github/codeql-action/init@v2
33+ uses : github/codeql-action/init@v3
3434 with :
3535 languages : ' c-cpp'
3636 # If you wish to specify custom queries, you can do so here or in a config file.
@@ -44,20 +44,10 @@ jobs:
4444 # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
4545 # If this step fails, then you should remove it and run the build manually (see below)
4646 - name : Autobuild
47- uses : github/codeql-action/autobuild@v2
48-
49- # ℹ️ Command-line programs to run using the OS shell.
50- # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
51-
52- # If the Autobuild fails above, remove it and uncomment the following three lines.
53- # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
54-
55- # - run: |
56- # echo "Run, Build Application using script"
57- # ./location_of_script_within_repo/buildscript.sh
47+ uses : github/codeql-action/autobuild@v3
5848
5949 - name : Perform CodeQL Analysis
60- uses : github/codeql-action/analyze@v2
50+ uses : github/codeql-action/analyze@v3
6151 with :
6252 category : " /language:c-cpp"
6353
@@ -73,53 +63,66 @@ jobs:
7363 uses : actions/checkout@v3
7464
7565 - name : flawfinder_scan
76- uses : david-a-wheeler/flawfinder@8e4a779ad59dbfaee5da586aa9210853b701959c
66+ uses : david-a-wheeler/flawfinder@2.0.19
7767 with :
7868 arguments : ' --sarif ./'
7969 output : ' flawfinder_results.sarif'
8070
8171 - name : Upload analysis results to GitHub Security tab
82- uses : github/codeql-action/upload-sarif@v2
72+ uses : github/codeql-action/upload-sarif@v3
8373 with :
8474 sarif_file : ${{github.workspace}}/flawfinder_results.sarif
8575
86- # microsoft-analyze:
87- # permissions:
88- # contents: read # for actions/checkout to fetch code
89- # security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
90- # actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
91- # name: Microsoft Analyze
92- # runs-on: windows-latest
93-
94- # steps:
95- # - name: Checkout repository
96- # uses: actions/checkout@v3
97-
98- # - name: Configure CMake
99- # run: cmake -B ./build
100-
101- # # Build is not required unless generated source files are used
102- # # - name: Build CMake
103- # # run: cmake --build ./build
104-
105- # - name: Initialize MSVC Code Analysis
106- # uses: microsoft/msvc-code-analysis-action@04825f6d9e00f87422d6bf04e1a38b1f3ed60d99
107- # # Provide a unique ID to access the sarif output path
108- # id: run-analysis
109- # with:
110- # cmakeBuildDirectory: ${{ env.build }}
111- # # Ruleset file that will determine what checks will be run
112- # ruleset: NativeRecommendedRules.ruleset
113-
114- # # Upload SARIF file to GitHub Code Scanning Alerts
115- # - name: Upload SARIF to GitHub
116- # uses: github/codeql-action/upload-sarif@v2
117- # with:
118- # sarif_file: ${{ steps.run-analysis.outputs.sarif }}
119-
120- # # Upload SARIF file as an Artifact to download and view
121- # # - name: Upload SARIF as an Artifact
122- # # uses: actions/upload-artifact@v3
123- # # with:
124- # # name: sarif-file
125- # # path: ${{ steps.run-analysis.outputs.sarif }}
76+ microsoft-analyze :
77+ permissions :
78+ actions : read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
79+ contents : read # for actions/checkout to fetch code
80+ security-events : write # for github/codeql-action/upload-sarif to upload SARIF results
81+ name : Microsoft Analyze
82+ runs-on : windows-latest
83+
84+ env :
85+ # Path to the CMake build directory.
86+ build : ' ${{ github.workspace }}/build'
87+ config : ' Debug'
88+
89+ steps :
90+ - name : Checkout repository
91+ uses : actions/checkout@v3
92+
93+ - name : VCPKG Install (Windows)
94+ uses : ./.github/workflows/windows-vcpkg
95+ with :
96+ key : ${{ runner.os }}-${{ env.config }}
97+
98+ - name : Configure CMake
99+ run : cmake -B ${{ env.build }} -DCMAKE_BUILD_TYPE=${{ env.config }}
100+
101+ # Build is not required unless generated source files are used
102+ # - name: Build CMake
103+ # run: cmake --build ${{ env.build }} --config ${{ env.config }}
104+
105+ - name : Run MSVC Code Analysis
106+ uses : microsoft/msvc-code-analysis-action@v0.1.1
107+ # Provide a unique ID to access the sarif output path
108+ id : run-analysis
109+ with :
110+ cmakeBuildDirectory : ${{ env.build }}
111+ buildConfiguration : ${{ env.config }}
112+ # Ruleset file that will determine what checks will be run
113+ ruleset : NativeRecommendedRules.ruleset
114+ # Paths to ignore analysis of CMake targets and includes
115+ # ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test
116+
117+ # Upload SARIF file to GitHub Code Scanning Alerts
118+ - name : Upload SARIF to GitHub
119+ uses : github/codeql-action/upload-sarif@v3
120+ with :
121+ sarif_file : ${{ steps.run-analysis.outputs.sarif }}
122+
123+ # # Upload SARIF file as an Artifact to download and view
124+ # - name: Upload SARIF as an Artifact
125+ # uses: actions/upload-artifact@v4
126+ # with:
127+ # name: sarif-file
128+ # path: ${{ steps.run-analysis.outputs.sarif }}
0 commit comments