Skip to content

Commit

Permalink
chore: Update CI workflow to output test reports on failure
Browse files Browse the repository at this point in the history
Signed-off-by: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
  • Loading branch information
thombashi committed May 18, 2024
1 parent 7fa0841 commit a696ff5
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,21 @@ jobs:
- run: make setup-ci

- name: Run tests
run: tox -e py
env:
REPORT_OUTPUT: md_report.md
run: |
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
tox -e py -- --md-report-output "${REPORT_OUTPUT}"
- name: Output reports to the job summary when tests fail
if: failure() && matrix.os != 'ubuntu-latest'
run: |
if [ -f "$REPORT_FILE" ]; then
echo "<details><summary>Failed Test Report</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "$REPORT_FILE" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
else
echo "No failed tests to report"
fi

0 comments on commit a696ff5

Please sign in to comment.