@@ -279,14 +279,15 @@ jobs:
279
279
280
280
# 🔁 This now ensures the stage fails if tests fail
281
281
if [ "$TOTAL_FAILED" -gt 0 ]; then
282
+ echo "Making the stage fail due to test failures."
282
283
exit 1
283
284
else
284
285
exit 0
285
286
fi
286
287
287
288
# Code Coverage Check only if tests executed successfully
288
289
- name : Code Coverage Check
289
- if : ${{ steps.test-execution.outputs.tests_executed == 'tests_execution_successful' }}
290
+ if : ${{ always() && steps.test-execution.outputs.tests_executed == 'tests_execution_successful' }}
290
291
run : |
291
292
echo "Code coverage: Checking if code coverage is above threshold..."
292
293
export TESTCOV_THRESHOLD=50
@@ -303,7 +304,7 @@ jobs:
303
304
304
305
# Post build status along with test summary as a comment only if tests executed successfully
305
306
- name : Post build status and test summary
306
- if : ${{ steps.test-execution.outputs.tests_executed == 'tests_execution_successful' }}
307
+ if : ${{ always() && steps.test-execution.outputs.tests_executed == 'tests_execution_successful' }}
307
308
uses : peter-evans/create-or-update-comment@v4
308
309
with :
309
310
comment-id : ${{ github.event.client_payload.github.payload.comment.id }}
@@ -319,7 +320,7 @@ jobs:
319
320
320
321
# Post only Build Status and workflow info as Comment if tests execution is not successful
321
322
- name : Post build status and workflow info
322
- if : ${{ steps.test-execution.outputs.tests_executed == 'tests_execution_not_successful' || !steps.test-execution.outputs.tests_executed }}
323
+ if : ${{ always() && ( steps.test-execution.outputs.tests_executed == 'tests_execution_not_successful' || !steps.test-execution.outputs.tests_executed) }}
323
324
uses : peter-evans/create-or-update-comment@v4
324
325
with :
325
326
comment-id : ${{ github.event.client_payload.github.payload.comment.id }}
@@ -339,4 +340,21 @@ jobs:
339
340
echo "Job Status: $STATUS 😢"
340
341
else
341
342
echo "Job Status: $STATUS ✅"
342
- fi
343
+ fi
344
+
345
+ - name : Debugging Information
346
+ if : always()
347
+ env :
348
+ TESTS_EXECUTED : ${{ steps.test-execution.outputs.tests_executed }}
349
+ run : |
350
+ echo "Debugging information:"
351
+ echo "tests_executed: $TESTS_EXECUTED"
352
+
353
+ echo "GITHUB_ENV content:"
354
+ cat "$GITHUB_ENV"
355
+
356
+ echo "GITHUB_OUTPUT content:"
357
+ cat "$GITHUB_OUTPUT" || echo "GITHUB_OUTPUT not found"
358
+
359
+ echo "Test summary file content:"
360
+ cat test_summary.txt || echo "No test summary file found."
0 commit comments