diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 524646a..3c01788 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,7 +31,7 @@ jobs: run: bun install --frozen-lockfile - name: Run Tests - run: bun test + run: bash shared/scripts/test-sequential.sh # ========================================================================== # Build Job diff --git a/shared/scripts/test-sequential.sh b/shared/scripts/test-sequential.sh new file mode 100755 index 0000000..8652e1f --- /dev/null +++ b/shared/scripts/test-sequential.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +echo "๐Ÿ” Finding test files..." +TEST_FILES=$(find . -name "*.test.ts" -not -path "*/node_modules/*") + +if [ -z "$TEST_FILES" ]; then + echo "โš ๏ธ No test files found!" + exit 0 +fi + +echo "๐Ÿงช Running tests sequentially..." +FAILED=0 + +for FILE in $TEST_FILES; do + echo "---------------------------------------------------" + echo "running: $FILE" + if bun test "$FILE"; then + echo "โœ… passed: $FILE" + else + echo "โŒ failed: $FILE" + FAILED=1 + # Fail fast + exit 1 + fi +done + +if [ $FAILED -eq 0 ]; then + echo "---------------------------------------------------" + echo "โœ… All tests passed!" + exit 0 +else + echo "---------------------------------------------------" + echo "โŒ Some tests failed." + exit 1 +fi