t1k:ci-speed
| Field | Value |
|---|---|
| Module | t1k-devops |
| Version | 4.1.3 |
| Effort | medium |
| Tools | — |
Keywords: ci audit, ci too slow, ci-speed, critical path, flaky test, fold jobs, github actions speed, longest-first, lpt scheduling, micro-jobs, post-merge only, runner minutes, runner mix, slow ci, step count, test sharding, wall-to-green
How to invoke
Section titled “How to invoke”/t1k:ci-speedmeasure | audit | critical-path | flakeCI Speed — Cut GitHub Actions Wall-to-Green
Section titled “CI Speed — Cut GitHub Actions Wall-to-Green”Turns “CI is slow” into a measured critical path and a short list of levers. Every lever here was
measured on The1Studio/theonekit-core (2026-09-29): PR wall-to-green went from 30–90 min to a
~5 min median (n=15).
Apply when: a PR takes too long to go green, a workflow is being added or reviewed for cost,
or a check is flaky. Trigger/runner authoring rules stay in
modules/t1k-devops/rules/ci-cd-trigger-design.md; this skill is the speed workflow on top of them.
Decision Tree
Section titled “Decision Tree”| Intent | Path |
|---|---|
| “CI is slow” — no numbers yet | Measure first → references/measuring-wall-to-green.md |
| “Which job do I fix?” | Critical path, not total |
| “Review this repo’s workflows for speed” | references/audit-checklist.md — heaviest-first |
| “Windows/macOS leg dominates” / “too many jobs” / “long tail after the last step” | references/workflow-levers.md |
| “The test job is the critical path” | references/test-suite-speed.md |
| “A check is flaky” | references/test-suite-speed.md § Flakes — never rerun hoping |
| “Red after I fixed the workflow” / “release step 403s” / “old base” | Gotchas |
Measure first
Section titled “Measure first”- Wall-to-green = last push of the head SHA → last check run completed on it. Not the duration of one workflow, not the sum of jobs.
- Per-job and per-step durations from the jobs of the run:
bun "$G" get repos/<o>/<r>/actions/runs/<id>/jobs --group g3(per-stepstarted_at/completed_at;$Gand its exit codes:skills/t1k-git/references/gh-status-lookup.md). The proxy projection omitsrunner_nameandlabels; read those with the directgh apiform inreferences/measuring-wall-to-green.md§ 3. - Always report n and the runner. On a mixed self-hosted pool the SAME step took ~90 s on
server runners (label
cicd) and 140–340 s on donor desktops; a “PR vs main” gap was really runner mix. One run is an anecdote.
Exact commands: references/measuring-wall-to-green.md.
Critical path, not total
Section titled “Critical path, not total”Find the ONE job every required check waits on — the latest completed_at among required checks.
Shaving any other job is noise for wall-to-green (it still saves runner minutes, which is the
audit’s axis, not this one). Re-measure after each lever; the critical path moves.
Levers, in the order they usually pay
Section titled “Levers, in the order they usually pay”| Lever | Typical win | Detail |
|---|---|---|
| Slow platform leg (Windows ~800–1150 s) → post-merge only, PR-side no-op matrix entry keeps the check name reporting, plus a “failing on main” auto-issue job | Largest single cut | references/workflow-levers.md §1 |
Trigger hygiene — pull_request: branches:[main] + push to main only; no paths: on required checks, decide relevance in a changes job | Removes duplicate/blocked runs | §2 |
Fold micro-jobs (each pays ~20–60 s pickup + checkout + setup) into one job with per-step if: !cancelled() && steps.setup.outcome == 'success' | ~minutes on fan-in | §3 |
| Cut step count (~1 s/step log upload tail) with a manifest-driven runner | 119 → 9 steps | §4 |
| Test suite: longest-first scheduling, shard the giant file, parallel syntax loops | Critical-path test job | references/test-suite-speed.md |
Runner pinning is a queueing trade-off, not a free win. Pinning to cicd removes donor-desktop
variance but contends for ~6 shared org runners; theonekit-core’s owner chose NOT to pin. Present
both numbers and let the owner decide. Credential/Docker jobs are not a choice: they pin cicd
(runner policy: docs/ci-cd-trigger-design.md § “Rule 9”).
Executed by
Section titled “Executed by”Mostly judgment — which job is the critical path, which lever pays, whether a pin’s queueing cost
is acceptable — so it runs in t1k-devops-engineer (or inline). Routing SSOT:
docs/orchestration-rules.md § “Task-Type → Agent Routing”.
| Step | Agent |
|---|---|
| Pull per-job/step durations and runner names for N runs, tabulate | t1k-metrics-reporter |
| Wait for a re-measure run to settle | t1k-ci-watcher |
| Pick the critical path and lever; edit workflows | t1k-devops-engineer (not cheap) |
| Root-cause a flake | t1k-debugger (not cheap) |
References
Section titled “References”references/measuring-wall-to-green.md— commands for wall-to-green, per-job/step, runner mix, baseline hygiene, infra faults, API budgetreferences/workflow-levers.md— post-merge legs, trigger hygiene, job folding, step countreferences/test-suite-speed.md— LPT scheduling, sharding, parallel loops, pool sizing, flakesreferences/sharding-recipe.md— shard partition + aggregator check, selector leak, wall-to-green with queue, CPU quota, commit scopesreferences/audit-checklist.md— reviewing any repo’s workflows, heaviest-first