From eedfe98de9ff3e7fc0e62d755592da8e1a4112b5 Mon Sep 17 00:00:00 2001 From: derrickfink Date: Mon, 14 Sep 2026 18:22:39 -0600 Subject: [PATCH] perf(ci): infra jest transpile-only + shared tsc type-check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make ts-jest transpile-only (isolatedModules) so jest workers stop re-type-checking the whole project each — the dominant cost of the infra suite (the long pole once backend went parallel in #1111). Add a single 'tsc --noEmit' (npm run build) step to the infra CI job so type safety is preserved on PRs (previously only ts-jest enforced it; tsc ran only in teardown.yml). Workers stay at 2 (the --maxWorkers bump regressed 2.5x in #1112). No const enum in the tree, so isolatedModules is safe. Verified: tsc clean; 178 tests green transpile-only. --- .github/workflows/tests.yml | 6 ++++++ infrastructure/jest.config.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a53a08d26..7dea55e10 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -154,6 +154,12 @@ jobs: - name: Install working-directory: infrastructure run: npm ci --prefer-offline + - name: Type-check (tsc --noEmit) + working-directory: infrastructure + # Single shared type-check for the whole project. jest now transpiles + # only (isolatedModules), so this is where infra type errors are caught + # on a PR — cheaper once here than re-run inside every jest worker. + run: npm run build - name: Run tests working-directory: infrastructure run: npx jest --maxWorkers=2 diff --git a/infrastructure/jest.config.js b/infrastructure/jest.config.js index e9a420407..15b3c4cbb 100644 --- a/infrastructure/jest.config.js +++ b/infrastructure/jest.config.js @@ -4,6 +4,12 @@ module.exports = { testMatch: ['**/*.test.ts'], transform: { '^.+\\.tsx?$': ['ts-jest', { + // Transpile-only: skip per-worker type-checking (each jest worker + // otherwise re-type-checks the whole project with no shared cache, the + // dominant cost of this suite). Type safety is enforced once by the + // `tsc --noEmit` step in the CI job (.github/workflows/tests.yml) and by + // `npm run build` locally. Safe here: no `const enum` in the tree. + isolatedModules: true, diagnostics: { ignoreCodes: [151002], },