Skip to content

Commit 8758881

Browse files
committed
Add code coverage
1 parent e38c0e6 commit 8758881

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ jobs:
110110
- name: Run all tests and coverage
111111
working-directory: ./example/android
112112
run: ./gradlew :usercentrics_sdk:testDebugUnitTest :usercentrics_sdk:koverHtmlReport
113+
- name: List coverage files
114+
working-directory: ./example
115+
run: find build -name "*.html" -o -name "index.html" | head -20
113116
- name: Upload coverage report
114117
uses: actions/upload-artifact@v4
115118
with:
@@ -144,9 +147,12 @@ jobs:
144147
- name: Run all tests
145148
working-directory: ./example/ios
146149
run: ../../scripts/ios_unit_tests.sh
150+
- name: List test results
151+
working-directory: ./example/ios
152+
run: ls -la TestResults.xcresult || echo "No test results found"
147153
- name: Generate HTML report
148154
working-directory: ./example/ios
149-
run: slather coverage --html --scheme Runner --workspace Runner.xcworkspace --output-directory html_report --source-directory ../../ios Runner.xcodeproj
155+
run: slather coverage --html
150156
- name: Upload coverage report
151157
uses: actions/upload-artifact@v4
152158
with:

android/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ apply plugin: 'com.android.library'
2828
apply plugin: 'kotlin-android'
2929
apply plugin: 'org.jetbrains.kotlinx.kover'
3030

31+
kover {
32+
reports {
33+
filters {
34+
excludes {
35+
classes(
36+
'*BuildConfig',
37+
'*.R',
38+
'*.R$*'
39+
)
40+
}
41+
}
42+
}
43+
}
44+
3145
android {
3246
namespace "com.usercentrics.sdk"
3347

example/ios/.slather.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage_service: cobertura_xml
2+
xcodeproj: Runner.xcodeproj
3+
workspace: Runner.xcworkspace
4+
scheme: Runner
5+
source_directory: ../../ios
6+
output_directory: html_report
7+
ignore:
8+
- Pods/*
9+
- ../**/*/Tests/*
10+
- ../**/*/Test/*
11+

0 commit comments

Comments
 (0)