Skip to content

Commit d6bb96c

Browse files
committed
feat: add kover for code coverage
This commit adds kover to the project for code coverage analysis and integrates it with the CI workflow. - Adds kover dependency and configuration for Android modules. - Includes a step to generate kover XML reports in the build workflow. - Utilizes the madrapps/jacoco-report action to display test coverage and enforce minimum coverage thresholds. - Adjusts the build trigger to run on pull requests instead of pushes to the develop branch. - Reduces the build timeout to 30 minutes.
1 parent d51146f commit d6bb96c

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

.github/workflows/Build.yaml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Build
22

33
on:
4-
push:
4+
pull_request:
55
branches:
66
- develop
7-
pull_request:
87

98
concurrency:
109
group: build-${{ github.ref }}
@@ -13,7 +12,7 @@ concurrency:
1312
jobs:
1413
build:
1514
runs-on: ubuntu-latest
16-
timeout-minutes: 60
15+
timeout-minutes: 30
1716

1817
steps:
1918
- name: Checkout
@@ -51,9 +50,30 @@ jobs:
5150
- name: Check Spotless
5251
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
5352

54-
- name: Upload build reports
53+
- name: UnitTest
54+
run: |
55+
./gradlew testDebugUnitTest --stacktrace
56+
57+
- name: Check Kover
58+
run: |
59+
./gradlew koverXmlReportDebug
60+
61+
- name: Display local test coverage
62+
uses: madrapps/jacoco-report@v1
63+
with:
64+
title: test coverage report
65+
min-coverage-overall: 40
66+
min-coverage-changed-files: 60
67+
update-comment: true
68+
skip-if-no-changes: true
69+
continue-on-error: false
70+
paths: |
71+
${{ github.workspace }}/**/build/reports/kover/reportDebug.xml
72+
token: ${{ secrets.GITHUB_TOKEN }}
73+
74+
- name: Upload lint reports
5575
if: always()
5676
uses: actions/upload-artifact@v3
5777
with:
5878
name: build-reports
59-
path: app/build/reports
79+
path: app/build/reports

0 commit comments

Comments
 (0)