Skip to content

Commit 3656a4d

Browse files
Comment stages should always run even one stage failed (#878)
1 parent eb96c6e commit 3656a4d

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/acceptance-test.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,15 @@ jobs:
279279
280280
# 🔁 This now ensures the stage fails if tests fail
281281
if [ "$TOTAL_FAILED" -gt 0 ]; then
282+
echo "Making the stage fail due to test failures."
282283
exit 1
283284
else
284285
exit 0
285286
fi
286287
287288
# Code Coverage Check only if tests executed successfully
288289
- 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' }}
290291
run: |
291292
echo "Code coverage: Checking if code coverage is above threshold..."
292293
export TESTCOV_THRESHOLD=50
@@ -303,7 +304,7 @@ jobs:
303304
304305
# Post build status along with test summary as a comment only if tests executed successfully
305306
- 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' }}
307308
uses: peter-evans/create-or-update-comment@v4
308309
with:
309310
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
@@ -319,7 +320,7 @@ jobs:
319320

320321
# Post only Build Status and workflow info as Comment if tests execution is not successful
321322
- 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) }}
323324
uses: peter-evans/create-or-update-comment@v4
324325
with:
325326
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
@@ -339,4 +340,21 @@ jobs:
339340
echo "Job Status: $STATUS 😢"
340341
else
341342
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

Comments
 (0)