From 8f2ac533241f782af2904cb559b7f77c69a82081 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Tue, 7 Jul 2026 05:10:26 -0700 Subject: [PATCH] fix(ci): build engine package before running backend tests src/mcp/find-opportunities.ts imports packages/gittensory-miner/lib/opportunity-fanout.js (committed, pre-built), which imports @jsonbored/gittensory-engine. That package's dist/ is gitignored and only exists after the 'Build engine package' step, but the step ran after 'Test with coverage' and was gated on the narrow packages/gittensory-engine/** path filter, so any backend PR that didn't touch the engine package directly failed to resolve it. --- .github/workflows/ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81d5d9850b..0840a00bc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -265,6 +265,16 @@ jobs: - name: Typecheck if: ${{ github.event_name == 'push' || needs.changes.outputs.backend == 'true' }} run: npm run typecheck + # Moved ahead of "Test with coverage" (#ci-engine-build-order): src/mcp/find-opportunities.ts (root + # backend, since #2281/#3985) imports packages/gittensory-miner/lib/opportunity-fanout.js -- committed, + # pre-built JS -- which itself imports @jsonbored/gittensory-engine. That package's dist/ is gitignored + # and only exists after this build step, so ANY backend test run needs it built first, not just a PR + # that happens to touch packages/gittensory-engine/** directly (this step's original, too-narrow + # trigger, back when the two packages were still independent). Running late (its original position, + # after coverage) meant test:coverage failed to resolve the package on every PR that didn't touch it. + - name: Build engine package + if: ${{ github.event_name == 'push' || needs.changes.outputs.backend == 'true' || needs.changes.outputs.engine == 'true' }} + run: npm run build --workspace @jsonbored/gittensory-engine - name: Prepare test reports dir if: ${{ github.event_name == 'push' || needs.changes.outputs.backend == 'true' }} run: mkdir -p reports/junit @@ -392,9 +402,6 @@ jobs: - name: MCP package check if: ${{ github.event_name == 'push' || needs.changes.outputs.mcp == 'true' }} run: npm run test:mcp-pack - - name: Build engine package - if: ${{ github.event_name == 'push' || needs.changes.outputs.engine == 'true' }} - run: npm run build --workspace @jsonbored/gittensory-engine - name: Build miner CLI if: ${{ github.event_name == 'push' || needs.changes.outputs.miner == 'true' }} run: npm run build:miner