File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Copied from https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.23/README.md#support-fork-repositories-and-dependabot-branches
2+ # Warning: changes to this workflow will NOT be picked up until they land in the main branch!
3+ # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
4+
5+ name : Publish test results
6+
7+ on :
8+ workflow_run :
9+ workflows : [Tests]
10+ types : [completed]
11+
12+ jobs :
13+ publish-test-results :
14+ name : Publish test results
15+ runs-on : ubuntu-latest
16+ if : github.event.workflow_run.conclusion != 'skipped'
17+
18+ # Needed to post comments on the PR
19+ permissions :
20+ checks : write
21+ pull-requests : write
22+
23+ steps :
24+ - name : Download and extract artifacts
25+ env :
26+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
27+ run : |
28+ mkdir artifacts && cd artifacts
29+
30+ artifacts_url=${{ github.event.workflow_run.artifacts_url }}
31+
32+ gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
33+ do
34+ IFS=$'\t' read name url <<< "$artifact"
35+ gh api $url > "$name.zip"
36+ unzip -d "$name" "$name.zip"
37+ done
38+
39+ - name : Publish Unit Test Results
40+ uses : EnricoMi/publish-unit-test-result-action@v1
41+ with :
42+ commit : ${{ github.event.workflow_run.head_sha }}
43+ event_file : artifacts/Event File/event.json
44+ event_name : ${{ github.event.workflow_run.event }}
45+ files : artifacts/**/*.xml
Original file line number Diff line number Diff line change 11name: Debug passwordless `ssh localhost`
22
3- on : []
4- # on: [pull_request] # Uncomment to enable
3+ on: [push, pull_request]
54
65jobs:
76 test:
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ jobs:
130130 - name : Coverage
131131 uses : codecov/codecov-action@v1
132132
133- - name : Upload test artifacts
133+ - name : Upload test results
134134 # ensure this runs even if pytest fails
135135 if : >
136136 always() &&
@@ -149,3 +149,14 @@ jobs:
149149 name : ${{ env.TEST_ID }}_cluster_dumps
150150 path : test_cluster_dump
151151 if-no-files-found : ignore
152+
153+ # Publish an artifact for the event; used by publish-test-results.yaml
154+ event_file :
155+ name : " Event File"
156+ runs-on : ubuntu-latest
157+ steps :
158+ - name : Upload
159+ uses : actions/upload-artifact@v2
160+ with :
161+ name : Event File
162+ path : ${{ github.event_path }}
You can’t perform that action at this time.
0 commit comments