Conversation
- 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.
| # This ensures the required check reports status on docs-only PRs. | ||
| if: ${{ !failure() && !cancelled() }} | ||
| runs-on: ubuntu-latest | ||
| services: |
There was a problem hiding this comment.
We may want to stick with the docker image db we've been using so that if it ever needs to be updated, we only need to change it in one place
| USE_MOCK_SERVICES: 'true' | ||
| ANON_DEVICE_JWT_SECRET: ci-test-secret-key-for-anonymous-devices | ||
| run: | | ||
| node apps/auth/dist/app.js > /tmp/auth.log 2>&1 & |
There was a problem hiding this comment.
Rather than hardcoding each service we could use the start npm script for each workspace in the apps directory like this: npm run start --worksspace=apps/** Then if we ever want to spin up another service it wouldn't need to be updated here.
There was a problem hiding this comment.
This would require an update to the existing start scripts to add the timeout logic.
| FORCE_REBUILD="${{ inputs.force_rebuild }}" | ||
| if [[ "$FORCE_REBUILD" == "true" || \ | ||
| if [[ "${{ github.event_name }}" == "workflow_dispatch" || \ | ||
| "${{ steps.changes.outputs.backend }}" == "true" || \ |
There was a problem hiding this comment.
We may want another changes ouput filter that just detects "apps" so we don't need to check backend and auth explicitly here.
Summary
Integration-Testsbehindlint-and-typecheckso lint/typecheck failures skip the ~8min integration jobpushtrigger from CI workflow (redundant with PR CI that already passed before merge)nightly-tests.yml) for full unit test suite with coveragedocs-onlyoutput fromdetect-changeshuskypre-push hook to catch typecheck/lint errors locally before they reach CIdetect-changesjob (removedb-initfilter,merge_base_shaoutput,fetch-depth: 0)Closes #164
Results
Integration-Tests job: 59 seconds (down from ~7 minutes average). CI run
Estimated savings
Test plan
detect-changes,lint-and-typecheck,unit-testsall greennode dev_env/init-db.mjsruns migrations and seeds on the runnerIntegration-Testsis skippednightly-tests.ymlmanually viaworkflow_dispatchto validatenpm run ci:testmockstill works locally (Docker-based path unchanged)