Skip to content

Commit d373238

Browse files
committed
ci: Add test reports workflow
- Upload unit test results as artifacts in test job - Add new workflow to generate reports from test artifacts - Reports failed tests as annotations on PRs
1 parent 233c038 commit d373238

2 files changed

Lines changed: 108 additions & 1 deletion

File tree

.github/workflows/code-checks.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
910
jobs:
1011
lint-vital:
1112
name: Lint vitals
@@ -58,4 +59,14 @@ jobs:
5859
uses: ./.github/actions/common-setup
5960

6061
- name: Test modules
61-
run: ./gradlew ${{ matrix.flavor }}${{ matrix.variant }}UnitTest
62+
run: ./gradlew ${{ matrix.flavor }}${{ matrix.variant }}UnitTest
63+
64+
- name: Upload test results
65+
uses: actions/upload-artifact@v4.6.2
66+
if: always()
67+
with:
68+
name: test-results-${{ matrix.flavor }}-${{ matrix.variant }}
69+
path: |
70+
**/build/test-results/**/*.xml
71+
**/build/reports/tests/**/*
72+
retention-days: 1

.github/workflows/test-reports.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Test Reports
2+
3+
on:
4+
workflow_run:
5+
workflows: [ 'Code tests & eval' ]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: read
11+
actions: read
12+
checks: write
13+
pull-requests: read
14+
15+
jobs:
16+
report:
17+
runs-on: ubuntu-22.04
18+
if: always()
19+
steps:
20+
- name: Test Report - FOSS Debug
21+
uses: dorny/test-reporter@v2.1.1
22+
if: always()
23+
with:
24+
name: 'Unit Tests - testFoss Debug'
25+
artifact: test-results-testFoss-Debug
26+
path: '**/*.xml'
27+
reporter: java-junit
28+
fail-on-error: false
29+
list-suites: 'failed'
30+
list-tests: 'failed'
31+
max-annotations: 10
32+
33+
- name: Test Report - FOSS Beta
34+
uses: dorny/test-reporter@v2.1.1
35+
if: always()
36+
with:
37+
name: 'Unit Tests - testFoss Beta'
38+
artifact: test-results-testFoss-Beta
39+
path: '**/*.xml'
40+
reporter: java-junit
41+
fail-on-error: false
42+
list-suites: 'failed'
43+
list-tests: 'failed'
44+
max-annotations: 10
45+
46+
- name: Test Report - FOSS Release
47+
uses: dorny/test-reporter@v2.1.1
48+
if: always()
49+
with:
50+
name: 'Unit Tests - testFoss Release'
51+
artifact: test-results-testFoss-Release
52+
path: '**/*.xml'
53+
reporter: java-junit
54+
fail-on-error: false
55+
list-suites: 'failed'
56+
list-tests: 'failed'
57+
max-annotations: 10
58+
59+
- name: Test Report - GPlay Debug
60+
uses: dorny/test-reporter@v2.1.1
61+
if: always()
62+
with:
63+
name: 'Unit Tests - testGplay Debug'
64+
artifact: test-results-testGplay-Debug
65+
path: '**/*.xml'
66+
reporter: java-junit
67+
fail-on-error: false
68+
list-suites: 'failed'
69+
list-tests: 'failed'
70+
max-annotations: 10
71+
72+
- name: Test Report - GPlay Beta
73+
uses: dorny/test-reporter@v2.1.1
74+
if: always()
75+
with:
76+
name: 'Unit Tests - testGplay Beta'
77+
artifact: test-results-testGplay-Beta
78+
path: '**/*.xml'
79+
reporter: java-junit
80+
fail-on-error: false
81+
list-suites: 'failed'
82+
list-tests: 'failed'
83+
max-annotations: 10
84+
85+
- name: Test Report - GPlay Release
86+
uses: dorny/test-reporter@v2.1.1
87+
if: always()
88+
with:
89+
name: 'Unit Tests - testGplay Release'
90+
artifact: test-results-testGplay-Release
91+
path: '**/*.xml'
92+
reporter: java-junit
93+
fail-on-error: false
94+
list-suites: 'failed'
95+
list-tests: 'failed'
96+
max-annotations: 10

0 commit comments

Comments
 (0)