Skip to content

Commit ac0407f

Browse files
committed
publish test results
1 parent 9ba4cc6 commit ac0407f

3 files changed

Lines changed: 114 additions & 21 deletions

File tree

.github/workflows/java-all-versions.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,42 @@ jobs:
2020
- name: Build with Gradle
2121
run: ./gradlew assemble
2222
- name: Test with Java 8
23+
id: test_java8
2324
run: ./gradlew test -PtestOnJava=8 --stacktrace
2425

25-
- name: Test Report
26-
uses: dorny/test-reporter@v1
27-
if: success() || failure()
26+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
27+
if: ${{ !cancelled() && steps.test_java8.outcome != 'skipped'}}
2828
with:
29-
name: Java 8 Test Report
29+
name: test-results-j8
3030
path: 'test-results/**/*.xml'
31-
report-type: junit
3231

3332
- name: Test with Java 11
33+
id: test_java11
3434
run: ./gradlew test -PtestOnJava=11 --stacktrace
3535

36-
- name: Test Report
37-
uses: dorny/test-reporter@v1
38-
if: success() || failure()
36+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
37+
if: ${{ !cancelled() && steps.test_java1.outcome != 'skipped'}}
3938
with:
40-
name: Java 11 Test Report
39+
name: test-results-j11
4140
path: 'test-results/**/*.xml'
4241

4342
- name: Test with Java 17
43+
id: test_java17
4444
run: ./gradlew test -PtestOnJava=17 --stacktrace
4545

46-
- name: Test Report
47-
uses: dorny/test-reporter@v1
48-
if: success() || failure()
46+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
47+
if: ${{ !cancelled() && steps.test_java17.outcome != 'skipped'}}
4948
with:
50-
name: Java 17 Test Report
49+
name: test-results-j17
5150
path: 'test-results/**/*.xml'
5251

5352
- name: Test with Java 21
53+
id: test_java21
5454
run: ./gradlew test -PtestOnJava=21 --stacktrace
5555

56-
- name: Test Report
57-
uses: dorny/test-reporter@v1
58-
if: success() || failure()
56+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
57+
if: ${{ !cancelled() && steps.test_java21.outcome != 'skipped'}}
5958
with:
60-
name: Java 21 Test Report
59+
name: test-results-j21
6160
path: 'test-results/**/*.xml'
6261

.github/workflows/macos.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
- name: Build with Gradle
1717
run: ./gradlew assemble
1818
- name: Test with Gradle
19+
id: test_macos_java11
1920
run: ./gradlew test
2021

21-
- name: Test Report
22-
uses: dorny/test-reporter@v1
23-
if: success() || failure()
22+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
23+
if: ${{ !cancelled() && steps.test_macos_java11.outcome != 'skipped'}}
2424
with:
25-
name: Java 1 macos Test Report
25+
name: test-results-macos-j11
2626
path: 'test-results/**/*.xml'
27+
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 'Test Report'
2+
on:
3+
workflow_run:
4+
workflows: ['Java 8, 11, 17, 21 CI', 'Java 11 CI macOS (Apple)'] # runs after CI workflow
5+
types:
6+
- completed
7+
permissions:
8+
contents: read
9+
actions: read
10+
checks: write
11+
jobs:
12+
report:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check for test-results-j8 artifact
16+
id: check_j8
17+
uses: actions/download-artifact@v4
18+
with:
19+
name: test-results-j8
20+
path: temp-j8
21+
continue-on-error: true
22+
23+
- name: Check for test-results-j11 artifact
24+
id: check_j11
25+
uses: actions/download-artifact@v4
26+
with:
27+
name: test-results-j11
28+
path: temp-j11
29+
continue-on-error: true
30+
31+
- name: Check for test-results-j8 artifact
32+
id: check_j17
33+
uses: actions/download-artifact@v4
34+
with:
35+
name: test-results-j17
36+
path: temp-j17
37+
continue-on-error: true
38+
39+
- name: Check for test-results-j21 artifact
40+
id: check_j21
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: test-results-j21
44+
path: temp-j21
45+
continue-on-error: true
46+
47+
- name: Check for test-results-j21 artifact
48+
id: check__macos_j11
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: test-results-macos-j11
52+
path: temp-macos-j11
53+
continue-on-error: true
54+
55+
- uses: dorny/test-reporter@v1
56+
if: ${{ steps.check_j8.outcome == 'success' }}
57+
with:
58+
artifact: test-results-j8 # artifact name
59+
name: Java 8 Tests # Name of the check run which will be created
60+
path: '*.xml' # Path to test results (inside artifact .zip)
61+
reporter: java-junit # Format of test results
62+
63+
- uses: dorny/test-reporter@v1
64+
if: ${{ steps.check_j11.outcome == 'success' }}
65+
with:
66+
artifact: test-results-j11 # artifact name
67+
name: Java 11 tests # Name of the check run which will be created
68+
path: '*.xml' # Path to test results (inside artifact .zip)
69+
reporter: java-junit # Format of test results
70+
71+
- uses: dorny/test-reporter@v1
72+
if: ${{ steps.check_j17.outcome == 'success' }}
73+
with:
74+
artifact: test-results-j17 # artifact name
75+
name: Java 17 tests # Name of the check run which will be created
76+
path: '*.xml' # Path to test results (inside artifact .zip)
77+
reporter: java-junit # Format of test results
78+
79+
- uses: dorny/test-reporter@v1
80+
if: ${{ steps.check_j21.outcome == 'success' }}
81+
with:
82+
artifact: test-results-j21 # artifact name
83+
name: Java 21 tests # Name of the check run which will be created
84+
path: '*.xml' # Path to test results (inside artifact .zip)
85+
reporter: java-junit # Format of test results
86+
87+
- uses: dorny/test-reporter@v1
88+
if: ${{ steps.check__macos_j11.outcome == 'success' }}
89+
with:
90+
artifact: test-results-macos-j11 # artifact name
91+
name: Java 11 macos tests # Name of the check run which will be created
92+
path: '*.xml' # Path to test results (inside artifact .zip)
93+
reporter: java-junit # Format of test results

0 commit comments

Comments
 (0)