Unverified Commit 2a4e165e authored by Alexander Poddubny's avatar Alexander Poddubny Committed by GitHub

Fixes CI to fail the job for a fork PRs when general tests fail (#3412)

# Description

Fail the pre-merge CI job for a fork PRs when general tests fail
- Add step to check test results for PRs from forks
- Parse XML test report to detect failures/errors
- Fail job immediately if tests don't pass for fork PRs
- Maintain existing behavior for same-repo PRs

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent ca2fd911
...@@ -121,11 +121,19 @@ jobs: ...@@ -121,11 +121,19 @@ jobs:
retention-days: 1 retention-days: 1
compression-level: 9 compression-level: 9
- name: Fail on Test Failure for Fork PRs - name: Check Test Results for Fork PRs
if: github.event.pull_request.head.repo.full_name != github.repository && steps.run-general-tests.outcome == 'failure' if: github.event.pull_request.head.repo.full_name != github.repository
run: | run: |
if [ -f "reports/general-tests-report.xml" ]; then
# Check if the test results contain any failures
if grep -q 'failures="[1-9]' reports/general-tests-report.xml || grep -q 'errors="[1-9]' reports/general-tests-report.xml; then
echo "Tests failed for PR from fork. The test report is in the logs. Failing the job." echo "Tests failed for PR from fork. The test report is in the logs. Failing the job."
exit 1 exit 1
fi
else
echo "No test results file found. This might indicate test execution failed."
exit 1
fi
combine-results: combine-results:
needs: [test-isaaclab-tasks, test-general] needs: [test-isaaclab-tasks, test-general]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment