Skip to content

Commit 068e917

Browse files
ci: Fail the whole nightly job at the end if the testing step has failed [skip tests] (#4564)
## Context The testing step has been marked with `continue-on-error: true` in the nightly testing CIs because we want to execute additional steps on failure (e.g. notify in Teams). Due to this the failure status is not being reported at the job level. An example - https://github.com/ansys/pyfluent/actions/runs/18671795452 <img width="1199" height="766" alt="image" src="https://github.com/user-attachments/assets/d6ab4f0a-611a-4985-a5e9-daa2c165fa73" /> ## Change Summary A final step has been added to set the job as failed if the testing step was failed before. ## Rationale We want to mark the job failed in a delayed manner, so that we can execute additional steps on failure. By default, a job retuns immediately from a failed step. ## Impact This change will correctly mark the failed job in GitHub. --------- Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent e91dc31 commit 068e917

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/test-podman-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,10 @@ jobs:
178178
179179
echo "Sending notification to Power Automate..."
180180
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
181+
182+
183+
- name: Check test run status and fail the whole job if tests failed
184+
if: steps.fluent_test.outcome != 'success'
185+
run: |
186+
echo "One or more tests failed. Failing the job."
187+
exit 1

.github/workflows/test-run-dev-version-nightly.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,10 @@ jobs:
170170
171171
echo "Sending notification to Power Automate..."
172172
curl -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" "${{ secrets.PYFLUENT_WEBHOOK_URL }}"
173+
174+
- name: Check test run status and fail the whole job if tests failed
175+
if: steps.unittest.outcome != 'success'
176+
run: |
177+
echo "One or more tests failed. Failing the job."
178+
exit 1
179+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fail the whole nightly job at the end if the testing step has failed [skip tests]

0 commit comments

Comments
 (0)