Skip to content

Commit c4f7716

Browse files
authored
workflows: mark workflow failed when tests fail (#1158)
When tests fail the workflow should be marked as failed. This change allows reporting action to mark worflow as failed when: - test results are missing - there are failed tests in results
2 parents 29b3a23 + e407063 commit c4f7716

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ jobs:
131131
echo $GITHUB_WORKSPACE
132132
ls -R $GITHUB_WORKSPACE
133133
134-
- name: Publish Test Results
135-
uses: EnricoMi/publish-unit-test-result-action@v2
136-
with:
137-
files: "${{ github.workspace }}/artifacts/**/*.xml"
138-
139134
- name: Publish Test Job Details
140135
run: |
141136
for json_file in $(find ${{ github.workspace }} -name "test-job-*.json")
@@ -146,3 +141,10 @@ jobs:
146141
echo " * [Job $JOB_ID on $DEVICE_TYPE]($URL)"
147142
echo " * [Job $JOB_ID on $DEVICE_TYPE]($URL)" >> $GITHUB_STEP_SUMMARY
148143
done
144+
145+
- name: Publish Test Results
146+
uses: EnricoMi/publish-unit-test-result-action@v2
147+
with:
148+
files: "${{ github.workspace }}/artifacts/**/*.xml"
149+
action_fail: true
150+
action_fail_on_inconclusive: true

0 commit comments

Comments
 (0)