Files
frameledger/.github/workflows/codeql.yml
T
poli0981andClaude Opus 5.5 a644dd873e ci(sonar): SonarCloud from CI - the sonarcloud job, SonarQube.Analysis.xml, the scanner as a local tool, the C++ through the compilation database; Dependabot cooldown, the NuGet audit, CodeQL reads the workflows (beta.29 PR-1) (#334)
The owner turned SonarCloud's Automatic Analysis off and set SONAR_TOKEN (2026-10-24) and asked for
the CI-based analysis with the newest scanner, run until its gate passed, and for Dependabot, the
audit and code scanning to be brought up to date (owner decision D68, replacing D67).

- ci.yml: a second job, sonarcloud, after check - SonarScanner for .NET 12.0.0 from
  .config/dotnet-tools.json; begin -> its own `dotnet build` -> end. Its own build because the
  scanner's targets turn TreatWarningsAsErrors off in the build they instrument. Advisory, not a
  required check; sonar.qualitygate.wait makes a failed gate a red job. Runs for this repository's
  pull requests (not a fork's, not Dependabot's - no secret) and for main: the organisation's plan
  refuses any other branch ("not allowed to access data from non main branches"). Permissions per
  job, none at workflow level (githubactions:S8264 on the first analysis).
- Coverage: build.ps1 collects "XPlat Code Coverage;Format=cobertura,opencover"; the job downloads
  check's artifact. C# only: sonar.coverage.exclusions leaves the PowerShell tools and src/native,
  which have no coverage report, out of the figures (SonarCloud counted build.ps1's 232 executable
  lines as uncovered).
- C++: FrameLedger.Infrastructure.csproj names src/native's .cpp/.h as FlNativeSource items that
  exist only while the scanner instruments the build; analysed with CMake's compilation database
  (configure with CMAKE_CXX_SCAN_FOR_MODULES=OFF - the .modmap response files only a build writes
  stopped CFamily - and fl_ac_floor_gen): 32 compilation units, all in full.
- SonarQube.Analysis.xml replaces .sonarcloud.properties; the version is the newest v* tag, so the
  project's "Previous version" new code is everything since the last release; S8417 (src/native)
  and csharpsquid:S6640 (Infrastructure, Shared) ignored where they apply by design;
  sonar.cs.roslyn.ignoreIssues.
- Dependabot: a seven-day cooldown on version updates; the actions' minor and patch releases
  grouped. It has never proposed a NuGet library update here (#66-#314: analyzers only) - beta.29
  PR-2 makes the missed ones. Directory.Build.props: the NuGet audit written down (all, low).
  codeql.yml: the actions language; superseded pull-request runs cancelled.
- Docs: 13_CI_CD (ci.yml, codeql.yml, SonarCloud rewritten with D67 kept as history and the first
  analyses measured, Dependabot and the NuGet audit, the checklist), 12_BUILD, CLAUDE.md, HANDOFF's
  D68 row, the wiki's Releasing page, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 11:00:35 +07:00

88 lines
2.6 KiB
YAML

# CodeQL for C# AND C++ (docs/13_CI_CD.md).
#
# The native layer is where memory-safety bugs would live — a lock-free ring
# written from inside a host process we do not own. Scanning only the managed
# side would defeat the purpose.
#
# Repo-local for now. The ops repo has codeql-mixed.yml, but C++ needs manual
# build mode driven by the CMake preset, and that input surface has not been
# verified. Switch to a caller stub once it has.
#
# AND the workflows themselves, since 2026-10-25: CodeQL's `actions` language
# reads .github/workflows for injection from event data, untrusted checkouts
# and over-broad tokens — the same class of finding SonarCloud raised once
# (githubactions:S7631, wiki.yml, beta.26). Its context, `analyze (actions,
# none)`, is not one of main's required checks.
name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '27 4 * * 1'
permissions:
contents: read
security-events: write
# A new push to a pull request replaces its run. A push to main and the weekly
# scan each get a group of their own (the run id), so none of them is ever
# cancelled or left pending behind another, and the default branch's alerts
# always come from a finished analysis.
concurrency:
group: codeql-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
analyze:
runs-on: windows-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: none
- language: cpp
build-mode: manual
- language: actions
build-mode: none
steps:
- uses: actions/checkout@v7
- name: Set up .NET
if: matrix.language == 'csharp'
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
- name: Set up MSVC (x64)
if: matrix.language == 'cpp'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: x64
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Build native
if: matrix.language == 'cpp'
shell: pwsh
run: |
cmake --preset x64-release
cmake --build --preset x64-release
working-directory: src/native
- name: Analyze
uses: github/codeql-action/analyze@v4
with:
category: /language:${{ matrix.language }}