File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 6363 with :
6464 name : alternate-report-path-reports
6565 path : somewhere/custom-report.html
66+ test-show-failure :
67+ runs-on : ubuntu-18.04
68+ name : Demonstrates failure case
69+ steps :
70+ - uses : actions/checkout@v1
71+ - id : xunit-viewer
72+ uses : ./ # use the current project relative to root
73+ with :
74+ results : test/failure
75+ - name : Attach the report
76+ if : always()
77+ uses : actions/upload-artifact@v1
78+ with :
79+ name : ${{ steps.xunit-viewer.outputs.report-name }}
80+ path : ${{ steps.xunit-viewer.outputs.report-dir }}
6681 test-detection :
6782 runs-on : ubuntu-18.04
6883 name : Run tests to ensure detection is working
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ outputs:
2525 description : " The file path where the report can be found. Equal to 'output' input."
2626 report-dir :
2727 description : " The directory where the report can be found."
28+ report-name :
29+ description : " Use this name with Artifact Upload for unique attachments"
2830runs :
2931 using : ' docker'
3032 image : ' Dockerfile'
Original file line number Diff line number Diff line change @@ -39,9 +39,11 @@ mkdir -p "$(dirname "$output")"
3939
4040xunit-viewer --results=" $results " --output=" $output " --console=true --title=" $title "
4141
42+ recommended_attachment_name=echo " test-results-$GITHUB_REPOSITORY -$GITHUB_WORKFLOW -$HOSTNAME -$GITHUB_RUN_ID "
4243
4344echo ::set-output name=report-file::" $output " # reference available to other actions
4445echo ::set-output name=report-dir::" $report_dir " # for easy attachment of a folder
46+ echo ::set-output name=report-name::" $recommended_attachment_name " # to provide a globally unique name for downloading results
4547
4648# report non zero exit code if any failure or error detected
4749if " $fail " == " true" ; then
You can’t perform that action at this time.
0 commit comments