When tests fail in CI, reading through 4,000 lines of standard output in GitHub Actions logs is a slow, frustrating developer experience.
# Output JUnit XML from PHPUnit and upload with action:
- name: Run PHPUnit
run: vendor/bin/phpunit --log-junit test-results.xml
- name: Publish Test Results
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'test-results.xml'
Publishing JUnit test annotations places failure diffs directly on the exact line of code in the GitHub pull request interface, cutting diagnosis time from minutes to seconds.