U/sgriffin/vc2026 #391
Workflow file for this run
This file contains hidden or 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
| name: "CodeQL Advanced" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| schedule: | |
| - cron: '33 1 * * 2' # Run at 1:33 on Tuesdays | |
| permissions: | |
| contents: read | |
| jobs: | |
| analyze: | |
| name: Analyze (${{ matrix.language }}) | |
| # Use VS 2026 preview runner (GA May 4, 2026, then switch to windows-2025) | |
| runs-on: windows-2025-vs2026 | |
| permissions: | |
| packages: read | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - language: c-cpp | |
| build-mode: autobuild | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: 'recursive' | |
| - name: Install Windows 11 SDK (10.0.22621.0) | |
| shell: pwsh | |
| run: | | |
| $sdkPath = "${env:ProgramFiles(x86)}\Windows Kits\10\Include\10.0.22621.0" | |
| if (Test-Path $sdkPath) { | |
| Write-Host "Windows SDK 10.0.22621.0 already installed" | |
| exit 0 | |
| } | |
| # Download and verify installer | |
| $installer = "$env:TEMP\winsdksetup.exe" | |
| $expectedHash = "E9EB8CC489860F1F66B22B371A8413B5BEB2D2DA7B1E156DD65D1E65D37D1D79" | |
| Write-Host "Downloading Windows 11 SDK 10.0.22621.0..." | |
| Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/?linkid=2196241" -OutFile $installer | |
| # Verify SHA256 hash | |
| $actualHash = (Get-FileHash -Path $installer -Algorithm SHA256).Hash | |
| if ($actualHash -ne $expectedHash) { | |
| Write-Error "SHA256 hash mismatch! Expected: $expectedHash, Got: $actualHash" | |
| exit 1 | |
| } | |
| Write-Host "SHA256 verified: $actualHash" | |
| # Install SDK | |
| Write-Host "Installing SDK (this may take a few minutes)..." | |
| $proc = Start-Process -FilePath $installer -ArgumentList "/features OptionId.DesktopCPPx64 OptionId.DesktopCPPx86 OptionId.DesktopCPParm64 /quiet /norestart /log $env:TEMP\sdk_install.log" -Wait -PassThru | |
| if (!(Test-Path $sdkPath)) { | |
| Get-Content "$env:TEMP\sdk_install.log" -ErrorAction SilentlyContinue | Select-Object -Last 50 | |
| Write-Error "Windows SDK installation failed" | |
| exit 1 | |
| } | |
| Write-Host "Windows SDK 10.0.22621.0 installed successfully" | |
| # Initializes the CodeQL tools for scanning. | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2 | |
| with: | |
| languages: ${{ matrix.language }} | |
| build-mode: ${{ matrix.build-mode }} | |
| # If you wish to specify custom queries, you can do so here or in a config file. | |
| # By default, queries listed here will override any specified in a config file. | |
| # Prefix the list here with "+" to use these queries and those in the config file. | |
| # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | |
| # queries: security-extended,security-and-quality | |
| - name: Autobuild | |
| uses: github/codeql-action/autobuild@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2 | |
| - name: Perform CodeQL Analysis | |
| id: analyze | |
| uses: github/codeql-action/analyze@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2 | |
| with: | |
| category: "/language:${{matrix.language}}" | |
| - name: Upload CodeQL Analysis Results | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| path: ${{ steps.analyze.outputs.sarif-output }} |