Skip to content

Commit 555eb67

Browse files
committed
use some junit methods to report errors more verbosely
publish test results
1 parent 47e5b23 commit 555eb67

5 files changed

Lines changed: 296 additions & 60 deletions

File tree

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Java 8, 11, 17, 21 CI
22

3-
on: [push,pull_request]
3+
on: [ push,pull_request ]
44

55
jobs:
66
build:
@@ -17,13 +17,51 @@ jobs:
1717
11
1818
17
1919
21
20+
2021
- name: Build with Gradle
2122
run: ./gradlew assemble
23+
2224
- name: Test with Java 8
25+
id: test_java8
2326
run: ./gradlew test -PtestOnJava=8 --stacktrace
27+
28+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
29+
if: ${{ !cancelled() && steps.test_java8.outcome != 'skipped'}}
30+
with:
31+
name: test-results-j8
32+
path: '*/build/test-results/**/*.xml'
33+
overwrite: 'true'
34+
2435
- name: Test with Java 11
36+
id: test_java11
2537
run: ./gradlew test -PtestOnJava=11 --stacktrace
38+
39+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
40+
if: ${{ !cancelled() && steps.test_java11.outcome != 'skipped'}}
41+
with:
42+
name: test-results-j11
43+
path: '*/build/test-results/**/*.xml'
44+
overwrite: 'true'
45+
2646
- name: Test with Java 17
47+
id: test_java17
2748
run: ./gradlew test -PtestOnJava=17 --stacktrace
49+
50+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
51+
if: ${{ !cancelled() && steps.test_java17.outcome != 'skipped'}}
52+
with:
53+
name: test-results-j17
54+
path: '*/build/test-results/**/*.xml'
55+
overwrite: 'true'
56+
2857
- name: Test with Java 21
58+
id: test_java21
2959
run: ./gradlew test -PtestOnJava=21 --stacktrace
60+
61+
- uses: actions/upload-artifact@v4 # upload test results if the test was not skipped
62+
if: ${{ !cancelled() && steps.test_java21.outcome != 'skipped'}}
63+
with:
64+
name: test-results-j21
65+
path: '*/build/test-results/**/*.xml'
66+
overwrite: 'true'
67+

.github/workflows/macos.yml

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

0 commit comments

Comments
 (0)