CI: cleanup and fix broken job references

- Fix code-size -> code-analysis job name (5 jobs had wrong dependency)
- Remove useless install-check job (was no-op)
- Add explicit docs_only guard to release-check
- Remove dead submodule checkout steps (no submodules in repo)
- Rename detect-docs-only -> detect-docs-changes, add docs_changed output
- Reorder check script: format first for faster fail
- Fix billing error test (PR #12946 removed fallback detection but not test)
This commit is contained in:
quotentiroler
2026-02-09 17:52:51 -08:00
parent 64cf50dfc3
commit 039aaf176e
6 changed files with 81 additions and 100 deletions

View File

@@ -19,10 +19,10 @@ Tier 1 — Cheapest gates (parallel, ~43 s)
check-format secrets
Tier 2 — After format (parallel, ~2 min)
check-lint code-size
check-lint code-analysis
Tier 3 — Build (~3 min)
build-artifacts install-check
build-artifacts release-check
Tier 4 — Tests (~5 min)
checks (node tsgo / test / protocol, bun test)
@@ -39,8 +39,8 @@ Tier 5 — Platform (most expensive)
```
docs-scope ──► changed-scope ──┐
check-format ──► check-lint ──►├──► build-artifacts ──► checks-windows
├─► code-size ──►├──► install-check
check-format ──► check-lint ──►├──► build-artifacts ──► release-check
├─► code-analysis ►│ └──► checks-windows
├──► checks
├──► macos
└──► android
@@ -65,37 +65,37 @@ secrets (independent)
### Tier 2 — After Format
| Job | Runner | Depends on | Purpose |
| ------------ | ----------------- | -------------- | ----------------------------------------------------------- |
| `check-lint` | Blacksmith 4 vCPU | `check-format` | Runs `pnpm lint` — cleaner output after format passes |
| `code-size` | Blacksmith 4 vCPU | `check-format` | Checks LOC thresholds — accurate counts need formatted code |
| Job | Runner | Depends on | Purpose |
| --------------- | ----------------- | -------------- | ----------------------------------------------------------- |
| `check-lint` | Blacksmith 4 vCPU | `check-format` | Runs `pnpm lint` — cleaner output after format passes |
| `code-analysis` | Blacksmith 4 vCPU | `check-format` | Checks LOC thresholds — accurate counts need formatted code |
### Tier 3 — Build
| Job | Runner | Depends on | Purpose |
| ----------------- | ----------------- | ------------------------- | ------------------------------------- |
| `build-artifacts` | Blacksmith 4 vCPU | `check-lint`, `code-size` | Builds dist and uploads artifact |
| `install-check` | Blacksmith 4 vCPU | `check-lint`, `code-size` | Verifies `pnpm install` works cleanly |
| Job | Runner | Depends on | Purpose |
| ----------------- | ----------------- | ----------------------------- | -------------------------------- |
| `build-artifacts` | Blacksmith 4 vCPU | `check-lint`, `code-analysis` | Builds dist and uploads artifact |
| `release-check` | Blacksmith 4 vCPU | `build-artifacts` | Validates npm pack contents |
### Tier 4+ — Tests and Platform
| Job | Runner | Depends on | Purpose |
| ---------------- | ------------------ | -------------------------------------------- | ------------------------------------------------------ |
| `checks` | Blacksmith 4 vCPU | `check-lint`, `code-size` | TypeScript checks, tests (Node + Bun), protocol checks |
| `checks-windows` | Blacksmith Windows | `build-artifacts`, `check-lint`, `code-size` | Windows-specific lint, tests, protocol checks |
| `macos` | `macos-latest` | `check-lint`, `code-size` | TS tests + Swift lint/build/test (PR only) |
| `android` | Blacksmith 4 vCPU | `check-lint`, `code-size` | Gradle test + build |
| Job | Runner | Depends on | Purpose |
| ---------------- | ------------------ | ------------------------------------------------ | ------------------------------------------------------ |
| `checks` | Blacksmith 4 vCPU | `check-lint`, `code-analysis` | TypeScript checks, tests (Node + Bun), protocol checks |
| `checks-windows` | Blacksmith Windows | `build-artifacts`, `check-lint`, `code-analysis` | Windows-specific lint, tests, protocol checks |
| `macos` | `macos-latest` | `check-lint`, `code-analysis` | TS tests + Swift lint/build/test (PR only) |
| `android` | Blacksmith 4 vCPU | `check-lint`, `code-analysis` | Gradle test + build |
## Code-Size Gate
## Code-Analysis Gate
The `code-size` job runs `scripts/analyze_code_files.py` on PRs to catch:
The `code-analysis` job runs `scripts/analyze_code_files.py` on PRs to catch:
1. **Threshold crossings** — files that grew past 1000 lines in the PR
2. **Already-large files growing** — files already over 1000 lines that got bigger
3. **Duplicate function regressions** — new duplicate functions introduced by the PR
When `--strict` is set, any violation fails the job and blocks all downstream
work. On push to `main`, the code-size steps are skipped (the job passes as a
work. On push to `main`, the code-analysis steps are skipped (the job passes as a
no-op) so pushes still run the full test suite.
### Excluded Directories
@@ -109,26 +109,25 @@ The analysis skips: `node_modules`, `dist`, `vendor`, `.git`, `coverage`,
**Bad PR (formatting violations):**
- `check-format` fails at ~43 s
- `check-lint`, `code-size`, and all downstream jobs never start
- `check-lint`, `code-analysis`, and all downstream jobs never start
- Total cost: ~1 runner-minute
**Bad PR (lint or LOC violations, good format):**
- `check-format` passes → `check-lint` and `code-size` run in parallel
- `check-format` passes → `check-lint` and `code-analysis` run in parallel
- One or both fail → all downstream jobs skipped
- Total cost: ~3 runner-minutes
**Good PR:**
- Critical path: `check-format` (43 s) → `check-lint` (1m 46 s) → `build-artifacts``checks`
- `code-size` runs in parallel with `check-lint`, adding no latency
- `code-analysis` runs in parallel with `check-lint`, adding no latency
## Composite Action
The `setup-node-env` composite action (`.github/actions/setup-node-env/`)
handles the shared setup boilerplate:
- Submodule init/update with retry (5 attempts, exponential backoff)
- Node.js 22 setup
- pnpm via corepack + store cache
- Optional Bun install
@@ -141,7 +140,7 @@ This eliminates ~40 lines of duplicated YAML per job.
## Push vs PR Behavior
| Trigger | `code-size` | Downstream jobs |
| Trigger | `code-analysis` | Downstream jobs |
| -------------- | ----------------------------- | --------------------- |
| Push to `main` | Steps skipped (job passes) | Run normally |
| Pull request | Full analysis with `--strict` | Blocked on violations |