-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add CodeQL Advanced analysis workflow #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
47efb01
ci: add CodeQL Advanced analysis workflow for C++
d25045c
ci: enable parallel MSBuild in CodeQL workflow
447f287
build(deps): bump GitHub Actions to latest versions
571b015
ci: restrict CodeQL to app/ and tools/, remove temp branch trigger
ee1cabf
ci: remove pull_request trigger from CodeQL workflow
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: "CodeQL Advanced" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '19 17 * * 3' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| security-events: write | ||
| packages: read | ||
| actions: read | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: pwsh | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: windows-2025-vs2026 | ||
| timeout-minutes: 180 | ||
|
|
||
| env: | ||
| GLOBAL_VCPKG_PATH: C:\vcpkg | ||
| VCPKG_DEFAULT_TRIPLET: x64-windows | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - language: c-cpp | ||
| build-mode: manual | ||
|
|
||
| steps: | ||
| # ── Checkout ────────────────────────────────────────────── | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| # ── Toolchain ───────────────────────────────────────────── | ||
| - name: Install CMake (Scoop) | ||
| uses: MinoruSekine/setup-scoop@v4 | ||
| with: | ||
| apps: cmake | ||
|
|
||
| - name: Setup MSVC developer environment | ||
| uses: ilammy/msvc-dev-cmd@v1 | ||
| with: | ||
| arch: x64 | ||
| vsversion: '18.0' | ||
|
|
||
| - name: Remove MinGW from PATH | ||
| run: | | ||
| $clean = ($env:PATH -split ';' | Where-Object { $_ -notmatch 'mingw' }) -join ';' | ||
| "PATH=$clean" >> $env:GITHUB_ENV | ||
|
|
||
| # ── Qt6 ─────────────────────────────────────────────────── | ||
| - name: Install Qt6 | ||
| uses: jurplel/install-qt-action@v4 | ||
| with: | ||
| version: '6.10.*' | ||
| arch: win64_msvc2022_64 | ||
| cache: true | ||
|
|
||
| # ── vcpkg ───────────────────────────────────────────────── | ||
| - name: Setup vcpkg binary caching (GitHub Actions) | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| script: | | ||
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
|
|
||
| - name: Restore vcpkg installed packages | ||
| id: vcpkg-cache | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: C:\vcpkg\installed | ||
| key: vcpkg-x64-windows-${{ hashFiles('vcpkg.json') }}-v1 | ||
| restore-keys: vcpkg-x64-windows- | ||
|
|
||
| - name: Install vcpkg packages | ||
| if: steps.vcpkg-cache.outputs.cache-hit != 'true' | ||
| env: | ||
| VCPKG_BINARY_SOURCES: clear;x-gha,readwrite | ||
| run: | | ||
| & C:\vcpkg\vcpkg install --triplet x64-windows ` | ||
| opencolorio openimageio openexr imath ` | ||
| "ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale]" ` | ||
| portaudio crashpad zlib libpng | ||
|
|
||
| # ── CodeQL ──────────────────────────────────────────────── | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: ${{ matrix.build-mode }} | ||
| config: | | ||
| paths: | ||
| - app | ||
| - tools | ||
|
|
||
| - name: Configure (CMake — Visual Studio generator) | ||
| env: | ||
| CC: cl | ||
| CXX: cl | ||
| run: cmake --preset windows-vs | ||
|
|
||
| - name: Build (MSBuild — parallel) | ||
| run: cmake --build build/vs --config Release --parallel | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v4 | ||
| with: | ||
| category: "/language:${{ matrix.language }}" | ||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cache key uses
hashFiles('vcpkg.json'), but this repo does not contain avcpkg.json, sohashFileswill be empty and the key will effectively be constant (risking stale/incorrect caches when the vcpkg package list changes). Use a hash input that actually changes with the package set (e.g., include this workflow file like Windows CI does, or hash a file that defines the dependency list).