File tree Expand file tree Collapse file tree 2 files changed +57
-7
lines changed Expand file tree Collapse file tree 2 files changed +57
-7
lines changed Original file line number Diff line number Diff line change 5
5
tags-ignore : [ "**" ]
6
6
pull_request :
7
7
release :
8
- types : [ released ]
8
+ types : [ published ]
9
9
jobs :
10
10
build :
11
11
# Only run on PRs if the source branch is on someone else's repo
@@ -19,13 +19,19 @@ jobs:
19
19
with :
20
20
distribution : ' temurin'
21
21
java-version : 17
22
+ - uses : gradle/gradle-build-action@v2
23
+ with :
24
+ # allow main and *-dev branches to write caches (default is only main/main)
25
+ cache-read-only : ${{ github.ref != 'refs/heads/main' && !(endsWith(github.ref, '-dev') && startsWith(github.ref, 'refs/heads/')) }}
22
26
- name : Build
23
27
run : ./gradlew build
24
- - name : Test Summary
25
-
26
- with :
27
- junit_files : " **/build/test-results/test/TEST-*.xml"
28
- if : always()
28
+ - name : Upload Test Results
29
+ if : always()
30
+ uses : actions/upload-artifact@v4
31
+ with :
32
+ name : Test Results
33
+ path : |
34
+ **/build/test-results/test/TEST-*.xml
29
35
- name : Determine Status
30
36
run : |
31
37
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
34
40
echo "STATUS=release" >> $GITHUB_ENV
35
41
fi
36
42
- name : Publish Snapshot
37
- if : " ${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master ' }}"
43
+ if : " ${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main ' }}"
38
44
run : ./gradlew publish
39
45
env :
40
46
ORG_GRADLE_PROJECT_sonatypeUsername : " ${{ secrets.SONATYPE_USERNAME }}"
47
53
ORG_GRADLE_PROJECT_sonatypePassword : " ${{ secrets.SONATYPE_PASSWORD }}"
48
54
ORG_GRADLE_PROJECT_signingKey : " ${{ secrets.SIGNING_KEY }}"
49
55
ORG_GRADLE_PROJECT_signingPassword : " ${{ secrets.SIGNING_PASSWORD }}"
56
+ event_file :
57
+ name : " Event File"
58
+ # Only run on PRs if the source branch is on someone else's repo
59
+ if : ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
60
+ runs-on : ubuntu-latest
61
+ steps :
62
+ - name : Upload
63
+ uses : actions/upload-artifact@v4
64
+ with :
65
+ name : Event File
66
+ path : ${{ github.event_path }}
Original file line number Diff line number Diff line change
1
+ name : Test Results
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : [ "Build cloud-spring" ]
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
+ permissions :
16
+ checks : write
17
+ # needed unless run with comment_mode: off
18
+ pull-requests : write
19
+ # required by download step to access artifacts API
20
+ actions : read
21
+ steps :
22
+ - name : Download and Extract Artifacts
23
+ uses : dawidd6/action-download-artifact@v3
24
+ with :
25
+ run_id : ${{ github.event.workflow_run.id }}
26
+ path : artifacts
27
+ - name : Publish Test Results
28
+ uses : EnricoMi/publish-unit-test-result-action@v2
29
+ with :
30
+ commit : ${{ github.event.workflow_run.head_sha }}
31
+ event_file : artifacts/Event File/event.json
32
+ event_name : ${{ github.event.workflow_run.event }}
33
+ files : " artifacts/**/*.xml"
You can’t perform that action at this time.
0 commit comments