Skip to content

Commit 430cacb

Browse files
committed
fix(ci): test failures should fail the build
The 'Check if tests exist' step was actually running tests with continue-on-error: true. If tests failed, it would set has-tests=false and skip the actual test step, making CI appear green even with failing tests. Simplified to use 'npm test --if-present' which: - Runs tests if a test script exists (and fails if tests fail) - Does nothing and exits 0 if no test script exists - Removes the need for the complex check logic Fixes the issue where PR #3014 had failing tests but CI was green.
1 parent 0d0d2f8 commit 430cacb

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

.github/workflows/typescript.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,9 @@ jobs:
4141
working-directory: src/${{ matrix.package }}
4242
run: npm ci
4343

44-
- name: Check if tests exist
45-
id: check-tests
46-
working-directory: src/${{ matrix.package }}
47-
run: |
48-
if npm run test --silent 2>/dev/null; then
49-
echo "has-tests=true" >> $GITHUB_OUTPUT
50-
else
51-
echo "has-tests=false" >> $GITHUB_OUTPUT
52-
fi
53-
continue-on-error: true
54-
5544
- name: Run tests
56-
if: steps.check-tests.outputs.has-tests == 'true'
5745
working-directory: src/${{ matrix.package }}
58-
run: npm test
46+
run: npm test --if-present
5947

6048
build:
6149
needs: [detect-packages, test]

0 commit comments

Comments
 (0)