File tree Expand file tree Collapse file tree 2 files changed +64
-1
lines changed Expand file tree Collapse file tree 2 files changed +64
-1
lines changed Original file line number Diff line number Diff line change 2020 distribution : ' temurin'
2121 cache : maven
2222 - name : Build with Maven
23- run : mvn -B package --file pom.xml
23+ run : mvn -D maven.test.failure.ignore=true -B package --file pom.xml
24+ - name : Upload Test Results
25+ uses : actions/upload-artifact@v3
26+ with :
27+ name : test-results-${{ matrix.os }}
28+ if-no-files-found : error
29+ path : |
30+ ${{ github.workspace }}/**/target/surefire-reports/*.xml
31+ event_file :
32+ name : " Event File"
33+ runs-on : ubuntu-latest
34+ steps :
35+ - name : Upload
36+ uses : actions/upload-artifact@v2
37+ with :
38+ name : Event File
39+ path : ${{ github.event_path }}
40+
2441
Original file line number Diff line number Diff line change 1+ name : Unit Test Results
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Maven Build"]
6+ types :
7+ - completed
8+ permissions : {}
9+
10+ jobs :
11+ test-results :
12+ name : Test Results
13+ runs-on : ubuntu-latest
14+ if : github.event.workflow_run.conclusion != 'skipped'
15+
16+ permissions :
17+ checks : write
18+ pull-requests : write
19+ contents : read
20+ issues : read
21+ actions : read
22+
23+ steps :
24+ - name : Download and Extract Artifacts
25+ env :
26+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
27+ run : |
28+ mkdir -p 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 Test Results
40+ uses : EnricoMi/publish-unit-test-result-action@v2
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+ junit_files : " artifacts/**/*.xml"
46+
You can’t perform that action at this time.
0 commit comments