Skip to content

ci: reduce CI minute consumption#157

Open
jakebromberg wants to merge 4 commits intomainfrom
task/reduce-ci-minutes
Open

ci: reduce CI minute consumption#157
jakebromberg wants to merge 4 commits intomainfrom
task/reduce-ci-minutes

Conversation

@jakebromberg
Copy link
Member

@jakebromberg jakebromberg commented Feb 14, 2026

Summary

  • Gate Integration-Tests behind lint-and-typecheck so lint/typecheck failures skip the ~8min integration job
  • Remove push trigger from CI workflow (redundant with PR CI that already passed before merge)
  • Remove dead ECR push step (the deploy workflow already handles SHA-tagged ECR pushes)
  • Add nightly scheduled workflow (nightly-tests.yml) for full unit test suite with coverage
  • Remove unused docs-only output from detect-changes
  • Add husky pre-push hook to catch typecheck/lint errors locally before they reach CI
  • Replace Docker image builds and container orchestration with GHA service containers (PostgreSQL) and native Node.js processes (auth + backend)
  • Remove ECR caching infrastructure (Buildx, ECR login, SHA-tagged image pull/build, merge-base tracking)
  • Simplify detect-changes job (remove db-init filter, merge_base_sha output, fetch-depth: 0)
  • Move env vars from workflow-level to Integration-Tests job-level
  • Enable TypeScript incremental compilation for faster typechecks

Closes #164

Results

Integration-Tests job: 59 seconds (down from ~7 minutes average). CI run

Estimated savings

  • ~5 min/run from replacing Docker with native processes in integration tests
  • ~88 min/month from gating integration tests behind lint (11 failed runs this month)
  • ~50 min/month from removing redundant push-to-main CI runs (~5 merges in 13 days)
  • Future failures caught locally by pre-push hook before consuming CI minutes

Test plan

  • CI passes: detect-changes, lint-and-typecheck, unit-tests all green
  • Integration-Tests job: PostgreSQL service container starts and is healthy
  • node dev_env/init-db.mjs runs migrations and seeds on the runner
  • Auth and backend processes start and pass healthchecks within 30s
  • Integration tests pass
  • Push a PR with a deliberate lint error; confirm Integration-Tests is skipped
  • Trigger nightly-tests.yml manually via workflow_dispatch to validate
  • Verify npm run ci:testmock still works locally (Docker-based path unchanged)
  • Close ci: skip redundant Docker builds in CI #158 and ci: fix Docker builder-stage layer caching #159 as superseded

Jake Bromberg added 4 commits February 13, 2026 20:10
- Gate Integration-Tests behind lint-and-typecheck so lint failures
  skip the ~8min integration job instead of wasting time on it
- Remove push-to-main trigger (redundant with PR CI that already passed)
- Remove dead ECR push step from CI (deploy workflow handles this)
- Add nightly scheduled workflow for full unit test suite coverage
- Remove unused docs-only output from detect-changes
- Add husky pre-push hook to catch typecheck/lint errors locally
The prepare script fails in Docker production builds where husky is not
installed (--omit=dev). Use "husky || true" so the script exits cleanly
when husky is unavailable.
Add "incremental": true to tsconfig.base.json. This generates
.tsbuildinfo files that allow tsc to skip re-checking unchanged files,
speeding up local typecheck and build iterations. The .tsbuildinfo files
are already in .gitignore.

Override incremental to false in shared/*/tsconfig.build.json since tsup
DTS builds don't support incremental without tsBuildInfoFile.
Replace Docker image builds and container orchestration with GHA service
containers (PostgreSQL) and native Node.js processes (auth + backend).
This eliminates ~5 minutes of Docker overhead per CI run.

Changes to detect-changes job:
- Remove merge-base SHA tracking (was for ECR cache tags)
- Remove db-init change filter (was for Docker rebuild decisions)
- Remove fetch-depth: 0 (no longer need full git history)
- Replace force_rebuild input with workflow_dispatch event check

Changes to Integration-Tests job:
- Add PostgreSQL service container (replaces Docker Compose ci-db)
- Run init-db.mjs directly on the runner (replaces ci-db-init container)
- Start auth and backend as background node processes (replaces Docker containers)
- Add healthcheck polling before running tests
- Add failure step to show service logs for debugging
- Move env vars from workflow-level to job-level (only this job needs them)
- Remove CI_PORT, CI_DB_PORT, CI_BETTER_AUTH_URL (redundant with native processes)
- Remove all Docker steps: Buildx, ECR login, image pull/build, compose up/down

Local CI scripts (ci-env.sh, ci-test.sh) remain unchanged.
@jakebromberg jakebromberg requested a review from AyBruno February 15, 2026 21: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.

Remove Docker from CI integration tests

1 participant