File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,22 @@ jobs:
5151 # Run tests with continue-on-error so that coverage and PR comments are always published.
5252 # The final step will explicitly fail the job if any test failed, ensuring PRs cannot be merged with failing tests.
5353 - name : Run pytest with coverage and generate JUnit XML
54+ id : pytest
5455 run : |
5556 PYTHONPATH=$(pwd) COVERAGE_FILE=tests/python/.coverage-${{ matrix.python-version }} pytest --cov=shared/python --cov-config=tests/python/.coveragerc --cov-report=html:tests/python/htmlcov-${{ matrix.python-version }} --junitxml=tests/python/junit-${{ matrix.python-version }}.xml tests/python/
5657 continue-on-error : true
5758
5859 - name : Upload coverage HTML report
60+ if : always()
5961 uses : actions/upload-artifact@v4
6062 with :
6163 name : coverage-html-${{ matrix.python-version }}
6264 path : tests/python/htmlcov-${{ matrix.python-version }}/
6365
6466 - name : Upload JUnit test results
67+ if : always()
6568 uses : actions/upload-artifact@v4
69+ continue-on-error : true
6670 with :
6771 name : junit-results-${{ matrix.python-version }}
6872 path : tests/python/junit-${{ matrix.python-version }}.xml
7781 # Explicitly fail the job if any test failed (so PRs cannot be merged with failing tests).
7882 # This runs after all reporting steps, meaning coverage and PR comments are always published.
7983 - name : Fail if tests failed
80- if : always()
84+ if : steps.pytest.outcome == 'failure'
8185 run : |
82- if grep -q 'failures="[1-9]' tests/python/junit-${{ matrix.python-version }}.xml; then
83- echo "::error ::Unit tests failed. See above for details."
84- exit 1
85- fi
86+ echo "::error ::Unit tests failed. See above for details."
87+ exit 1
You can’t perform that action at this time.
0 commit comments