Skip to content

ci: consolidate workflows and cut per-PR runner minutes - #493

Merged
thinkclay merged 1 commit into
mainfrom
claude/ci-consolidate-minutes
Jul 30, 2026
Merged

thinkclay merged 1 commit into
mainfrom
claude/ci-consolidate-minutes

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Stacked on #492 — review that one first; this PR's diff is .github/** plus one
package.json script, so it cannot regress the app.

Why now

Actions is currently blocked on the spending limit. Every job since ~12:45 UTC
today dies in 2 seconds:

The job was not started because recent account payments have failed or your spending
limit needs to be increased.

The last push that actually ran (12:34:29Z) burned ~70 runner-minutes across seven
workflows. This PR goes at that number.

What was duplicated

A PR touching packages/** fired 5 workflows / 8 jobs. Typecheck ran four times,
lint three times — integrity.yaml even ran pnpm typecheck as its own step
directly after pnpm check, which already contains that exact command.

Consolidation

  • test.yml + integrity.yaml → ci.yml, fronted by a dorny/paths-filter gate.
    That's the pattern contracts.yml already used and the only workflow in the repo that
    did. A docs-only PR now costs ~1 min instead of ~70.

  • scaffald-tests.yml deleted. Its unit job was already covered —
    apps/scaffald/project.json declares a test target on the same vitest config, so
    nx affected -t test picks up scaffald-app. Verified rather than assumed:

    $ nx show projects --affected --with-target test --files=apps/scaffald/app/_layout.tsx
    ["scaffald-app"]
    $ nx show projects --affected --with-target test --files=packages/scf-core/.../DrawerLayout.tsx
    ["scf-core","scaffald-app"]
    

    Its typecheck job duplicated work done twice elsewhere; its e2e step was
    continue-on-error so could never fail a PR; its Codecov upload is a no-op because
    CODECOV_TOKEN doesn't exist (Four CI secrets are referenced by workflows but have never existed #487). Both jobs also declared a supabase/postgres
    service container nothing connected to — the env vars point at Supabase's own
    bundled Postgres on 54322.

  • Lighthouse and E2E → nightly + workflow_dispatch + a ci:full PR label. Neither
    produced signal on a PR: E2E could not fail, and Lighthouse died at
    EXPO_PUBLIC_SUPABASE_URL is not set before measuring anything. E2E loses its
    continue-on-error in the move, so nightly failures now mean something. Per-push web
    coverage stays the deploy-web smoke test (4 routes + an SSR <title> assertion).

Point fixes

  • Nx cache key carried a -${{ github.sha }} suffix, so the primary key could never
    hit and every run wrote a fresh entry — churning the 10 GB repo cache and evicting
    the pnpm-store caches other workflows rely on.
  • api-tests benchmark gets needs: test; it was booting a second Supabase in
    parallel with the first.
  • weekly-load-tests had setup-node with cache: 'pnpm' before
    pnpm/action-setup — it has failed at setup every Monday.
  • check-circular-deps was nx graph --file=output.html: it built the graph (which
    does catch circular project deps) but wrote a 1 MB artifact nobody reads, and never
    checked circular imports despite the step name. Now nx show projects --json.
    Worth knowing: scripts/check-circular-deps.sh (madge, real import-cycle detection) is
    dead code the npm script never called — wiring it up is its own change, since it will
    surface real cycles.
  • permissions: on every workflow (10 had none), timeout-minutes on every job
    (integrity.yaml's two inherited the 360-minute default), concurrency on contracts.
  • Composite install action was pinned to setup-node@v4 while every caller used
    @v7. Now @v7, with a build-workspace-packages input.

Dependabot grouping — the biggest single lever

Ungrouped, it could open 15 concurrent single-dependency PRs, each triggering the full
fan-out: roughly a thousand runner-minutes per weekly wave. Now four groups plus one
for actions, with the Expo/RN family ignored so it stays one coordinated bump (#483) and
majors ignored outright.

Estimated effect

before after
per push (packages/**) ~60–95 min ~27 min
Dependabot week ~1050 min ~108 min
docs-only PR ~70 min ~1 min

Verification

All 15 workflows + dependabot.yml + the composite action parse, and every job has
permissions and timeout-minutes. pnpm check-circular-deps exits 0 with the new
command.

The honest limit: YAML behaviour can't be fully verified locally, and CI can't run at
all right now.
The observed job set needs confirming on the first real PR once the
billing block is lifted.

Branch protection needs updating

Required checks currently name jobs from the deleted workflows. New names:
Lint, typecheck & build, Unit tests, Monorepo integrity,
Contract Tests / contract-tests.

🤖 Generated with Claude Code

@thinkclay
thinkclay force-pushed the claude/tests-deps-upgrade-plan-f098b5 branch from 0323125 to 435d832 Compare July 30, 2026 17:43
@thinkclay
thinkclay force-pushed the claude/ci-consolidate-minutes branch from 7151575 to 0af24a8 Compare July 30, 2026 17:44
Base automatically changed from claude/tests-deps-upgrade-plan-f098b5 to main July 30, 2026 18:02
Actions is currently blocked on the spending limit — every job since ~12:45 UTC
today has died in 2 seconds with "the job was not started because recent account
payments have failed or your spending limit needs to be increased". The last
push that actually ran burned ~70 runner-minutes across seven workflows. This
change goes at that number.

A PR touching packages/** fired 5 workflows / 8 jobs. Typecheck ran four times
and lint three times; integrity.yaml even ran `pnpm typecheck` as its own step
directly after `pnpm check`, which already contains that exact command.

Consolidated:

- test.yml + integrity.yaml -> ci.yml, fronted by a dorny/paths-filter gate
  (the pattern contracts.yml already used, and the only one in the repo that
  did). A docs-only PR now costs ~1 minute instead of ~70.

- scaffald-tests.yml deleted. Its unit job was already covered:
  apps/scaffald/project.json declares a `test` target on the same vitest config,
  so `nx affected -t test` picks up scaffald-app whenever apps/scaffald or
  scf-core changes — verified with `nx show projects --affected`. Its typecheck
  job duplicated work done twice elsewhere, its e2e step was continue-on-error
  and so could never fail a PR, and its Codecov upload is a no-op because
  CODECOV_TOKEN does not exist (#487). Both jobs also declared a
  supabase/postgres service container that nothing connected to — the env vars
  point at Supabase's own bundled Postgres.

- Lighthouse and E2E move to nightly + workflow_dispatch + a `ci:full` PR label.
  Neither produced signal on a PR: E2E could not fail, and Lighthouse died at
  "EXPO_PUBLIC_SUPABASE_URL is not set" before measuring anything. E2E loses its
  continue-on-error in the move, so nightly failures now mean something.
  Per-push web coverage remains the deploy-web smoke test (4 routes + an SSR
  <title> assertion).

Point fixes:

- Nx cache key had a `-${{ github.sha }}` suffix, so the primary key could never
  hit and every run wrote a fresh entry — churning the 10 GB repo cache and
  evicting the pnpm-store caches other workflows rely on.
- api-tests `benchmark` gets `needs: test`; it was booting a second Supabase in
  parallel with the first.
- weekly-load-tests had setup-node with `cache: 'pnpm'` before pnpm/action-setup,
  so it failed at setup every Monday.
- check-circular-deps was `nx graph --file=output.html` — it built the graph
  (which does catch circular *project* deps) but wrote a 1 MB artifact nobody
  reads, and never checked circular *imports* despite the step name. Now
  `nx show projects --json > /dev/null`. Note scripts/check-circular-deps.sh
  (madge, real import-cycle detection) is dead code the npm script never called;
  wiring it up is its own change, since it will surface real cycles.
- permissions: on every workflow (10 had none), timeout-minutes on every job
  (integrity.yaml's two inherited the 360-minute default), concurrency on
  contracts.
- Composite install action: was pinned to setup-node@v4 while every caller used
  @v7. Now @v7, with a build-workspace-packages input so jobs needing a
  typecheck can build sdk+ui without each hand-rolling it.

Dependabot grouping is the single biggest lever: ungrouped it could open 15
concurrent single-dependency PRs, each triggering the full fan-out — roughly a
thousand runner-minutes per weekly wave. Grouped into four buckets plus one for
actions, with the Expo/RN family ignored so it stays one coordinated bump (#483)
and majors ignored outright.

Estimated: ~60-95 min/push -> ~27, and ~1050 min/dependabot-week -> ~108.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay force-pushed the claude/ci-consolidate-minutes branch from 0af24a8 to 93477ad Compare July 30, 2026 18:04
@thinkclay
thinkclay merged commit acd4dc0 into main Jul 30, 2026
1 of 7 checks passed
@thinkclay
thinkclay deleted the claude/ci-consolidate-minutes branch July 30, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant