File tree 2 files changed +59
-4
lines changed
2 files changed +59
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : Test Reports (PR)
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ["Pull Request"]
6
+ types :
7
+ - completed
8
+
9
+ permissions : {}
10
+
11
+ jobs :
12
+ test-results :
13
+ name : Test Results
14
+ runs-on : ubuntu-latest
15
+ if : github.event.workflow_run.conclusion != 'skipped'
16
+
17
+ permissions :
18
+ checks : write
19
+ pull-requests : write
20
+ actions : read
21
+
22
+ steps :
23
+ - name : Download and Extract Artifacts
24
+ env :
25
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
26
+ run : |
27
+ mkdir -p artifacts && cd artifacts
28
+
29
+ artifacts_url=${{ github.event.workflow_run.artifacts_url }}
30
+
31
+ gh api --paginate "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
32
+ do
33
+ IFS=$'\t' read name url <<< "$artifact"
34
+ gh api $url > "$name.zip"
35
+ unzip -d "$name" "$name.zip"
36
+ done
37
+
38
+ - name : Publish Test Results
39
+ uses : EnricoMi/publish-unit-test-result-action@v2
40
+ with :
41
+ commit : ${{ github.event.workflow_run.head_sha }}
42
+ event_file : artifacts/Event File/event.json
43
+ event_name : ${{ github.event.workflow_run.event }}
44
+ junit_files : " artifacts/Test Results/**/*.xml"
Original file line number Diff line number Diff line change 1
- name : CI ( Pull Request)
1
+ name : Pull Request
2
2
3
3
on :
4
4
pull_request :
@@ -65,12 +65,23 @@ jobs:
65
65
- name : Build with Maven
66
66
run : mvn --batch-mode -e clean install
67
67
68
- - name : Publish Test Report
69
- uses : scacap/action-surefire-report@v1
68
+ - name : Upload Test Results
70
69
if : success() || failure()
70
+ uses : actions/upload-artifact@v2
71
71
with :
72
- fail_if_no_tests : false
72
+ name : Test Results
73
+ path : |
74
+ target/surefire-reports/*.xml
73
75
74
76
- name : Build site
75
77
run : mvn --batch-mode -e -DskipTests site
76
78
79
+ event_file :
80
+ name : " Event File"
81
+ runs-on : ubuntu-latest
82
+ steps :
83
+ - name : Upload
84
+ uses : actions/upload-artifact@v2
85
+ with :
86
+ name : Event File
87
+ path : ${{ github.event_path }}
You can’t perform that action at this time.
0 commit comments