ci: self-hosted code quality grade and badge

A new quality job runs the linter battery (clippy, cppcheck, shellcheck,
ruff, lizard, jscpd, cargo-audit per crate, scc for the LOC denominator)
and feeds tools/quality/score.py: findings convert to SQALE remediation
minutes, debt ratio grades A-F on SonarQube's published grid, and a
separate worst-of security axis can only drag the overall grade down.
The job uploads the full quality.json breakdown and fails when the
security grade is worse than C.

The badges job now renders all four SVGs in-runner with anybadge
(shields hex palette); the previous img.shields.io curls were the one
external-service dependency left in the pipeline. quality.svg is seeded
at the current locally-computed grade (A, debt ratio 0.42%).

Also fixes the two ruff findings the battery surfaced in flowgen.py.
This commit is contained in:
BFE Engineering
2026-08-31 16:18:38 -06:00
parent e73996a53b
commit 249c311953
6 changed files with 357 additions and 13 deletions
Regular → Executable
+2 -2
View File
@@ -150,8 +150,8 @@ def main():
os.makedirs(OUT, exist_ok=True)
index = ["# Workflow Flowcharts", "",
"Generated by `tools/flowgen.py` from the modelled decision paths.",
"Each is an outcome-first flowchart of a workflow the SDK tests, with its"
" benchmark or MC/DC metric.", ""]
("Each is an outcome-first flowchart of a workflow the SDK tests,"
" with its benchmark or MC/DC metric."), ""]
for w in WORKFLOWS:
body = (f"# {w['title']}\n\n"
f"> **Outcome tested:** {w['outcome']}\n\n"