Skip to content

Commit 9fa3d6e

Browse files
committed
ci: report test results in PRs using a comment
Fixes: MODELIX-792
1 parent b57cc1d commit 9fa3d6e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313

1414
runs-on: ubuntu-latest
1515

16+
# Cf. https://github.com/marketplace/actions/publish-test-results#permissions
17+
permissions:
18+
checks: write
19+
pull-requests: write
20+
1621
steps:
1722
- uses: actions/checkout@v4
1823
- name: Set up JDK 11
@@ -26,8 +31,16 @@ jobs:
2631
env:
2732
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2833
run: ./gradlew --build-cache build detekt -PciBuild=true
34+
- name: Publish test results
35+
uses: EnricoMi/publish-unit-test-result-action@v2
36+
# Also report in case the build failed
37+
if: always()
38+
with:
39+
files: |
40+
**/test-results/**/*.xml
2941
- name: Archive test report
3042
uses: actions/upload-artifact@v4
43+
# Archive test reports for introspection even if the build failed. They are most useful in this situation.
3144
if: always()
3245
with:
3346
name: test-report

0 commit comments

Comments
 (0)