Skip to content

Commit 51b82ef

Browse files
committed
Add test and coverage reports to the GitHub Workflow
1 parent 965fc44 commit 51b82ef

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/gradle-build.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: Build
22
permissions:
33
contents: read
4+
actions: read
5+
checks: write
46
pull-requests: write
57

6-
on: [ push ]
8+
on:
9+
pull_request:
10+
push:
711

812
jobs:
913
build:
@@ -19,4 +23,21 @@ jobs:
1923
- name: Setup Gradle
2024
uses: gradle/actions/setup-gradle@v5
2125
- name: Build with Gradle
22-
run: ./gradlew build koverLog
26+
run: ./gradlew build koverLog koverXmlReport
27+
- name: Test Report
28+
uses: dorny/test-reporter@v2.1.1
29+
if: ${{ !cancelled() }} # run this step even if a previous step failed
30+
with:
31+
name: JUnit Tests
32+
path: ${{ github.workspace }}/build/test-results/**/TEST-*.xml
33+
reporter: java-junit
34+
- name: Add coverage to PR
35+
id: jacoco
36+
uses: madrapps/jacoco-report@v1.7.2
37+
with:
38+
paths: ${{ github.workspace }}/build/reports/kover/report.xml
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
min-coverage-overall: 90
41+
min-coverage-changed-files: 80
42+
title: Code Coverage
43+
update-comment: true

0 commit comments

Comments
 (0)