From dc188b9d2fa0fcc46d00b8bf5bc743b3f2048b34 Mon Sep 17 00:00:00 2001 From: Ferdinand Bachmann Date: Mon, 12 May 2025 20:16:48 +0200 Subject: [PATCH] github-actions: fix CI not detecting failed tests --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd4340a..624416a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,8 @@ jobs: - name: Run tests run: | - find build/test -type f -executable -name 'test-*' -exec sh -c 'echo "Running test: $1"; $1' _ {} \; + # search for all executables in build/test/test-* and run them + find build/test/ -type f -executable -name 'test-*' | (fail=0; while read test; do echo "Running test: $test"; "$test" || fail=$((fail+1)); done; exit $fail) build-and-test-c99-unix: strategy: matrix: @@ -72,5 +73,5 @@ jobs: - name: Run tests run: | - # search for all executables in build/test/test-* - find build/test -type f -executable -name 'test-*' -exec sh -c 'echo "Running test: $1"; $1' _ {} \; \ No newline at end of file + # search for all executables in build/test/test-* and run them + find build/test/ -type f -executable -name 'test-*' | (fail=0; while read test; do echo "Running test: $test"; "$test" || fail=$((fail+1)); done; exit $fail)