Files
frameledger/.github/workflows/ci.yml
T
poli0981andClaude Fable 5.2 49d7bd8e51 build: the main line on .NET 11 - SDK 11.0.100, net11.0, the three runtime-serviced packages at 11.0.0; Windows 10 stated as untested and unsupported (D94, D95) (beta.37 PR-1) (#376)
* build: the main line on .NET 11 - SDK 11.0.100, net11.0, the three runtime-serviced packages at 11.0.0; Windows 10 stated as untested and unsupported (D94, D95) (beta.37 PR-1)

The owner moved the main line to .NET 11 the day after it shipped (D94),
setting aside condition (a) of 20_OPEN_QUESTIONS section G's table - two
alphas on the released runtime. This is the alpha branch's switch applied
to main at released versions, and what follows from it.

- global.json 11.0.100 (allowPrerelease false), TFM
  net11.0-windows10.0.22621.0, Microsoft.Extensions.Hosting,
  Microsoft.Data.Sqlite and System.Diagnostics.EventLog 11.0.0;
  legal/licenses/nuget regenerated (78 packages -> 69).
- Two CA1307 sites the released SDK raised in tests written after the
  last alpha was cut take the (char, StringComparison) overload.
- IHost.RunAsync rethrows a failed BackgroundService on .NET 11: the
  Agent's --serve leaves through its crash report where it exited 0.
  Accepted, not wrapped; HostBackgroundFailureTests holds the runtime's
  behaviour, which nothing had observed.
- release.yml installs a .NET 10 runtime for vpk 1.2.161; Qodana's
  container installs the .NET 11 SDK first (interim, until the Ultimate
  linter); Dependabot's and the workflows' comments follow.
- Windows 10 22H2 is not blocked, and is stated as untested and
  unsupported (D95): NFR-8, LIMITATIONS, README, the guide, the wiki.
  A processor needs SSE4.2 and POPCNT.
- docs: 12_BUILD (the main line's .NET; the alpha line rests after
  alpha.4, D98), 13_CI_CD, 20_OPEN_QUESTIONS row closed, 10_LOGGING,
  spike-notes section 28, CLAUDE.md, the decisions index (D94-D96, D98).

Gate on the dev box: all passed in 338 s on SDK 11.0.100 (native 32/32,
2,561 tests, coverage floors held).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* build: what this pull request's runs measured on .NET 11 - CodeQL reads net11.0 whole, the delta from beta.36, Qodana's one finding fixed

- HostBackgroundFailureTests: the message is kept rather than the
  exception, so no `!` is needed - the one problem Qodana's interim run
  reported (run 42916491047, InspectCode 2026.2.3.1 on SDK 11.0.100).
- 13_CI_CD: what analyze (csharp, none) read of net11.0 (CodeQL 2.27.4,
  "scanned 1220 out of 1220 C# files", 363 references resolved, none
  unresolved), and the rule for C# 15 constructs (D96); the interim's
  first run.
- spike-notes section 28: the table of this pull request's runs - check,
  CodeQL, SonarCloud, Qodana, and the release rehearsal with the first
  delta across two runtime majors (72.6 MB, 372 of 443 files patched).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 23:13:00 +00:00

334 lines
16 KiB
YAML

# FrameLedger CI (docs/13_CI_CD.md).
#
# Repo-local rather than a caller stub, by necessity: the poli0981/.github
# reusable `desktop-csharp` template runs dotnet restore/build/test directly and
# exposes no input for a native pre-step, MSVC setup, or the Vulkan SDK.
# FrameLedger's build is mixed-toolchain and native-first, and docs/12_BUILD.md
# commits to CI running *the identical script* as local — a promise a
# pure-managed template cannot keep.
#
# So this workflow does exactly one thing of substance: ./build.ps1 check.
# Anything CI checks that local does not is a way for the two to disagree.
#
# Since 2026-10-25 (owner decision D68) a second job, `sonarcloud`, hands that
# run's coverage to SonarCloud and analyses the tree there. It is not the gate
# and not a required check: it builds again in a build of its own, and a
# SonarCloud outage or a failed quality gate is a red job beside a green
# `check`, never a blocked merge (docs/13_CI_CD.md §SonarCloud).
name: CI
on:
push:
# `alpha` since 2026-10-31 (D73, docs/13_CI_CD.md §The alpha line): the same source on the .NET that line is
# trying, whose merges and syncs from main need the same gate under its own global.json.
branches: [main, alpha]
pull_request:
workflow_dispatch:
# Permissions do not inherit into reusable workflows, and defaults are broader
# than this job needs either way (docs/13_CI_CD.md). Since the second job
# (2026-10-25) they are granted per job and the workflow grants none: a grant at
# this level reaches every job, so `sonarcloud` would have held `check`'s
# pull-requests read for nothing (SonarCloud githubactions:S8264).
permissions: {}
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: windows-latest
timeout-minutes: 40
permissions:
contents: read
# For the Changelog step below only: listing a pull request's changed files is
# the Pull Requests API, and an explicit `permissions:` block grants nothing it
# does not name. Read-only, and the job writes nothing back.
pull-requests: read
steps:
- uses: actions/checkout@v7
- name: Set up .NET
uses: actions/setup-dotnet@v6
with:
# Version comes from global.json. Pinning it twice is a way for the
# two pins to drift.
global-json-file: global.json
- name: Set up MSVC (x64)
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: x64
# PIN clang-format. Its output is version-dependent (alignment especially),
# so an unpinned binary means the formatting gate can pass locally and
# fail here for a reason the failure message does not mention — which is
# exactly what happened, and cost a CI round trip to diagnose.
#
# 12_BUILD promises CI runs the identical script. The script was identical;
# the tool was not. The runner image ships its own clang-format on PATH,
# and build.ps1 only falls back to the VS-bundled one when nothing is
# there — so this must come first and must be the version developers get
# from the pinned VS C++ workload.
#
# The version below is whatever `./build.ps1 check` PRINTS locally, not
# whatever `clang-format --version` says in an arbitrary shell. Those are
# not the same binary: this pin was briefly wrong for exactly that reason,
# because a different clang-format was earlier on PATH in a Git Bash
# session than the one build.ps1 resolves. The gate printing its own
# version is what caught it.
- name: Pin clang-format
shell: pwsh
run: |
pip install --disable-pip-version-check "clang-format==22.1.3"
clang-format --version
- name: Cache NuGet
uses: actions/cache@v6
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/Directory.Packages.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-
# No Vulkan SDK step, and there will not be one. The Khronos headers are
# vendored at src/native/third_party/vulkan-headers (Apache-2.0 OR MIT),
# so FrameLedger.VkLayer compiles here with nothing extra installed. That
# was the reason for vendoring rather than fetching: the alternative was a
# ~1 GB SDK download on every run. See that directory's README.md.
#
# The SDK is still needed to RUN tools/vklayer-blastradius.ps1, which
# registers the layer and inspects loader behaviour. That is deliberately
# not part of `build.ps1 check`: it mutates HKCU, and a CI runner is the
# wrong place to be registering machine-wide Vulkan layers.
# NO -SkipIntegration, since 2026-09-06, and the reason it was here is worth
# keeping: the drain end-to-end tests inject the Overlay into hook-harness,
# which makes the TEST HOST the target's parent — §S16 puts ancestors in the
# scan set — and a .NET host loads System.Security.Cryptography.ProtectedData.dll,
# whose name carries the heuristic fragment `protect`. From 2026-08-05 the
# guard refused our own harness here with SuspiciousUnsigned, and CI said out
# loud that it skipped nine cases. §S19(b)'s signer half now verifies that
# module's embedded signature offline and reads O=Microsoft Corporation, so
# the refusal is gone for the reason 19_SAFETY always gave ("fragment AND not
# signed by a known vendor"), and the nine cases are in the merge gate. The
# switch still exists in build.ps1 for a developer who must, and it skips
# loudly; CI is no longer a place it is passed.
- name: Quality gate
shell: pwsh
run: ./build.ps1 check
env:
CI: 'true'
# The ledger gate. It lives HERE, as a step of `check`, and NOT as a job of
# its own — deliberately, and the reason is §S23-2.
#
# `main`'s required contexts are exactly `check`, `analyze (csharp, none)`
# and `analyze (cpp, manual)`. A new job named `changelog` would go red and
# the merge button would stay green, which is precisely what already makes
# `Rules / validate` advisory. Adding a second instance of that is not a
# gate, it is a notification.
#
# It is also the one thing in this file that CI checks and `build.ps1` does
# not, which this workflow's header otherwise argues against. The exception
# is narrow and stated rather than assumed: this asserts a property of the
# PULL REQUEST — what changed against the base — and `build.ps1 check` runs
# on a working tree, not on a diff. Nothing about the build or the tests
# differs between here and a dev box. The gate's LOGIC is not CI-only: its
# self-test runs in `build.ps1 check` on every build, in both directions.
#
# The file list comes from GitHub's own view of the pull request rather than
# from `git diff`, so a shallow checkout cannot silently produce a short
# list — and the script refuses an EMPTY list rather than reading it as
# "no src/ changes, therefore fine".
# THE SIGNER PROBE'S CI LEG, printed. `ctest fl_signer_probe` runs inside the
# gate and passes on a regular expression, so its ANSWERS never reach this
# log — and §S19(b)'s rows G3/G4/G5 are pre-committed for exactly this
# machine's copy of the blocker. Run here, AFTER the gate, because the gate's
# restore is what fills the NuGet cache the probe searches first. A
# measurement, not a gate: continue-on-error so a surprise (row G6) is
# printed rather than turned into a red that hides it. Reading the row off
# the table is a separate PR (the probe says so itself).
- name: Signer probe (§S19(b) CI leg — measurement, not a gate)
if: always()
continue-on-error: true
shell: pwsh
run: ./build/native/x64-release/tools/fl-probe-signer/fl-probe-signer.exe
# §S29(d)'s pre-committed measurement: can tools/vklayer-blastradius.ps1 run
# HERE? It needs a Vulkan loader and vulkaninfo.exe, which ship with a GPU
# driver's runtime, not with Windows. A census, printed, never a gate.
# READ 2026-09-06 and again 2026-09-10 (run 34427267214): vulkan-1.dll
# PRESENT, vulkaninfo.exe ABSENT (System32 and PATH), no ICD registry key.
# So the "absent" row of 20_OPEN_QUESTIONS §S29(d) applies — deferred on
# that measurement, the script stays hand-run — and the "next PR wires the
# script" clause this comment used to carry is struck (2026-09-13). The
# step stays so a change in the runner image is noticed rather than assumed.
- name: Vulkan runtime census (§S29(d) — measurement, not a gate)
if: always()
continue-on-error: true
shell: pwsh
run: |
foreach ($f in 'C:\Windows\System32\vulkan-1.dll', 'C:\Windows\System32\vulkaninfo.exe') {
Write-Host ("{0}: {1}" -f $f, (Test-Path $f))
}
$cmd = Get-Command vulkaninfo.exe -ErrorAction SilentlyContinue
Write-Host ("vulkaninfo.exe on PATH: {0}" -f ($(if ($cmd) { $cmd.Source } else { 'no' })))
Write-Host ("HKLM:\SOFTWARE\Khronos\Vulkan\Drivers present: {0}" -f (Test-Path 'HKLM:\SOFTWARE\Khronos\Vulkan\Drivers'))
# Not for a pull request into `alpha` (D73): what the alpha line changes is written in its release's own file on
# main (docs/changelog/x.y.z-alpha.N.md), and an [Unreleased] entry on the alpha branch would collide with main's
# at every sync.
- name: Changelog
if: github.event_name == 'pull_request' && github.base_ref != 'alpha'
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
$ErrorActionPreference = 'Stop'
$files = gh api "repos/$env:GITHUB_REPOSITORY/pulls/$env:PR_NUMBER/files" --paginate -q '.[].filename'
if ($LASTEXITCODE -ne 0) { throw "could not list the pull request's changed files" }
./tools/changelog-check.ps1 -ChangedFiles @($files)
# Cobertura for a person reading it, OpenCover for the sonarcloud job below
# (build.ps1 writes both from the one test run since 2026-10-25).
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage
path: |
**/TestResults/**/coverage.cobertura.xml
**/TestResults/**/coverage.opencover.xml
if-no-files-found: warn
retention-days: 14
# SonarCloud, analysed from CI (owner decision D68, 2026-10-25; docs/13_CI_CD.md
# §SonarCloud). A job of its own, after `check`, for two reasons:
#
# - The scanner instruments the build it wraps and turns TreatWarningsAsErrors
# off in it (SonarQube.Integration.targets), so it cannot wrap the gate's
# build without weakening the gate. It gets a build of its own here.
# - It is advisory. `main`'s required contexts stay `check` and the two
# `analyze` jobs; a failed quality gate or a SonarCloud outage turns this job
# red and blocks nothing.
#
# It takes the gate's coverage (the `coverage` artifact) rather than running
# the tests a second time, and CMake's compilation database for the C++.
# Settings: SonarQube.Analysis.xml. The scanner: .config/dotnet-tools.json.
sonarcloud:
needs: check
# A pull request from this repository, or main. SONAR_TOKEN reaches neither a
# fork's pull request nor Dependabot's, and the scanner cannot start without
# it. Any other branch is refused by the organisation's plan - "Organization
# is not allowed to access data from non main branches", measured on a
# workflow_dispatch run of a feature branch, 2026-10-25 - so a dispatch on
# one runs `check` alone. The same plan is why a pull request INTO `alpha`
# (D73) and a push to it run `check` alone: SonarCloud analyses main's line.
if: >-
(github.event_name == 'pull_request' &&
github.base_ref != 'alpha' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'dependabot[bot]') ||
(github.event_name != 'pull_request' && github.ref == 'refs/heads/main')
runs-on: windows-latest
timeout-minutes: 40
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
# Blame for the new-code period, and the tags for the version.
fetch-depth: 0
- name: Set up .NET
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
# The analysis of the C++ runs the compiler of the compilation database.
- name: Set up MSVC (x64)
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: x64
- name: Cache NuGet
uses: actions/cache@v6
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/Directory.Packages.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-
# The JRE the scanner provisions, and SonarCloud's analysers.
- name: Cache SonarCloud
uses: actions/cache@v6
with:
path: ~/.sonar/cache
key: sonar-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }}
restore-keys: sonar-${{ runner.os }}-
# tests/<project>/TestResults/<guid>/coverage.opencover.xml, as `check` wrote
# them. Same workspace path on every hosted Windows runner, so the reports'
# absolute paths name these sources.
- name: Download the gate's coverage
uses: actions/download-artifact@v8
with:
name: coverage
# Configure only, plus the one header the build generates: the analysis
# reads the sources with the flags and defines CMake gives each one, and
# needs nothing built. FetchContent's sources land in build/, excluded.
#
# CMAKE_CXX_SCAN_FOR_MODULES=OFF: with C++20 and Ninja, CMake (3.28 on)
# scans every source for modules and gives each compile command an
# `@<object>.modmap` response file that only the BUILD writes, and the
# C/C++ analyser stops on a response file it cannot open ("unexpanded
# response file", the first run, 2026-10-25). Nothing here uses a module.
- name: Native compilation database
shell: pwsh
working-directory: src/native
run: |
cmake --preset x64-release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_SCAN_FOR_MODULES=OFF
if ($LASTEXITCODE -ne 0) { throw 'cmake configure failed' }
cmake --build --preset x64-release --target fl_ac_floor_gen
if ($LASTEXITCODE -ne 0) { throw 'generating the blocklist floor failed' }
# The version is the newest release tag the commit descends from, so the
# project's new-code period ("previous version") is everything since the
# last release.
- name: Begin the analysis
shell: pwsh
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
$ErrorActionPreference = 'Stop'
dotnet tool restore
if ($LASTEXITCODE -ne 0) { throw 'dotnet tool restore failed' }
$tag = git describe --tags --abbrev=0 --match 'v*' 2>$null
$version = if ($LASTEXITCODE -eq 0 -and $tag) { $tag.Substring(1) } else { (Get-Content VERSION -Raw).Trim() }
Write-Host "sonar.projectVersion: $version"
dotnet tool run dotnet-sonarscanner begin /k:poli0981_frameledger /o:poli0981 /v:$version `
/s:"$PWD\SonarQube.Analysis.xml" /d:sonar.token=$env:SONAR_TOKEN
if ($LASTEXITCODE -ne 0) { throw 'the scanner did not begin' }
# Platform: see build.ps1's Clear-VcxprojPlatform (the MSVC step exports
# Platform=x64, which MSBuild reads as a solution platform).
- name: Build for the analysis
shell: pwsh
run: |
Remove-Item Env:Platform -ErrorAction SilentlyContinue
dotnet build FrameLedger.slnx -c Release
if ($LASTEXITCODE -ne 0) { throw 'the analysis build failed' }
- name: End the analysis
shell: pwsh
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet tool run dotnet-sonarscanner end /d:sonar.token=$env:SONAR_TOKEN
if ($LASTEXITCODE -ne 0) { throw 'the analysis failed, or its quality gate did' }