Skip to content

Commit f79d4e6

Browse files
authored
hotfix: codeql workflow (#393)
This pull request updates the CodeQL workflow configuration in `.github/workflows/codeql.yml` to enhance language support. The workflow now builds the project manually instead of autobuild via CodeQL. CodeQL can now scan C++ and C# code. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated CodeQL workflow to combine C/C++ and C# language entries and switch to manual build mode with Ninja generator. * Added a CMake packaging step with improved compiler environment configuration for build consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 634fea5 + daadbf6 commit f79d4e6

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
include:
29-
- language: c-cpp
30-
build-mode: autobuild
29+
- language: c-cpp, csharp
30+
build-mode: manual
3131
compiler: gcc
32+
generator: Ninja
3233
version: 13
3334
os: ubuntu-latest
3435
steps:
@@ -126,6 +127,18 @@ jobs:
126127
# 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
127128
# queries: security-extended,security-and-quality
128129

130+
131+
- name: CMake Workflow with preset 'minimal-build' for packaging
132+
uses: lukka/run-cmake@v10
133+
with:
134+
workflowPreset: 'minimal-build'
135+
env:
136+
CMAKE_GENERATOR: ${{ matrix.generator }}
137+
CC: ${{ matrix.compiler == 'clang' && steps.set-up-clang.outputs.clang || matrix.compiler == 'gcc' && steps.set-up-gcc.outputs.gcc || '' }}
138+
CXX: ${{ matrix.compiler == 'clang' && steps.set-up-clang.outputs.clangxx || matrix.compiler == 'gcc' && steps.set-up-gcc.outputs.gxx || '' }}
139+
CMAKE_C_COMPILER: ${{ matrix.compiler == 'clang' && steps.set-up-clang.outputs.clang || matrix.compiler == 'gcc' && steps.set-up-gcc.outputs.gcc || '' }}
140+
CMAKE_CXX_COMPILER: ${{ matrix.compiler == 'clang' && steps.set-up-clang.outputs.clangxx || matrix.compiler == 'gcc' && steps.set-up-gcc.outputs.gxx || '' }}
141+
129142
- name: Perform CodeQL Analysis
130143
uses: github/codeql-action/analyze@v3
131144
with:

0 commit comments

Comments
 (0)