From 28a313206c7f1350ba946a923044f2f05a5a54f1 Mon Sep 17 00:00:00 2001 From: adam jones Date: Mon, 17 Nov 2025 21:41:31 +0000 Subject: [PATCH] fix(ci): test failures should fail the build (#3019) 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. --- .github/workflows/typescript.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml index 87717166..c99318bd 100644 --- a/.github/workflows/typescript.yml +++ b/.github/workflows/typescript.yml @@ -41,21 +41,9 @@ jobs: working-directory: src/${{ matrix.package }} run: npm ci - - name: Check if tests exist - id: check-tests - working-directory: src/${{ matrix.package }} - run: | - if npm run test --silent 2>/dev/null; then - echo "has-tests=true" >> $GITHUB_OUTPUT - else - echo "has-tests=false" >> $GITHUB_OUTPUT - fi - continue-on-error: true - - name: Run tests - if: steps.check-tests.outputs.has-tests == 'true' working-directory: src/${{ matrix.package }} - run: npm test + run: npm test --if-present build: needs: [detect-packages, test]