Skip to content

Commit fb297a5

Browse files
committed
fix: build SDK before running tests in CI
The test jobs run individual test files with 'bun test <file>', which bypasses the package.json pretest hook. This caused npm-app tests to fail with 'Cannot find module @codebuff/sdk' because the SDK wasn't built. Changes: - Added 'Build SDK before tests' step in test job - Added 'Build SDK before integration tests' step in test-integration job - This ensures SDK dist artifacts (index.mjs, index.cjs, vendor/) exist before tests that depend on @codebuff/sdk are executed Root cause: CI test command bypasses npm hooks by running test files directly.
1 parent 2059a9c commit fb297a5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ jobs:
130130
echo "NEXT_PUBLIC_INFISICAL_UP=true" >> $GITHUB_ENV
131131
echo "CODEBUFF_GITHUB_TOKEN=${{ secrets.CODEBUFF_GITHUB_TOKEN }}" >> $GITHUB_ENV
132132
133+
- name: Build SDK before tests
134+
run: cd sdk && bun run build
135+
133136
- name: Run ${{ matrix.package }} tests
134137
uses: nick-fields/retry@v3
135138
with:
@@ -201,6 +204,9 @@ jobs:
201204
echo "NEXT_PUBLIC_INFISICAL_UP=true" >> $GITHUB_ENV
202205
echo "CODEBUFF_GITHUB_TOKEN=${{ secrets.CODEBUFF_GITHUB_TOKEN }}" >> $GITHUB_ENV
203206
207+
- name: Build SDK before integration tests
208+
run: cd sdk && bun run build
209+
204210
- name: Run ${{ matrix.package }} integration tests
205211
uses: nick-fields/retry@v3
206212
with:

0 commit comments

Comments
 (0)