From ad28065a499df3d4c68f9ee895df18e91015b408 Mon Sep 17 00:00:00 2001 From: KaiUR Date: Tue, 2 Jun 2026 22:54:07 +0100 Subject: [PATCH] ci: add CodeQL security scanning workflow --- .github/workflows/codeql.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..e6facf4 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,46 @@ +name: CodeQL + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '0 6 * * 1' # weekly — Monday 06:00 UTC + +permissions: + contents: read + security-events: write + +jobs: + analyze: + name: Analyze (C/C++) + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + + - name: Add LLVM to PATH + run: echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: c-cpp + queries: security-and-quality + + - name: Configure with CMake + run: cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl + + - name: Build + run: cmake --build build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:c-cpp"