@@ -61,12 +61,21 @@ jobs:
6161 steps :
6262 - name : Checkout code
6363 uses : actions/checkout@v4
64+ - name : Install lcov
65+ run : sudo apt-get update && sudo apt-get install -y lcov
6466 - name : Get dependencies
6567 run : flutter pub get
6668 - name : Run all tests
6769 run : flutter test --reporter=expanded --coverage
6870 - name : Check coverage
6971 run : dart scripts/check_coverage.dart coverage/lcov.info
72+ - name : Generate HTML report
73+ run : genhtml coverage/lcov.info -o coverage/html
74+ - name : Upload coverage report
75+ uses : actions/upload-artifact@v4
76+ with :
77+ name : flutter-coverage-report
78+ path : coverage/html
7079
7180 test-android :
7281 name : Test Android
@@ -98,21 +107,29 @@ jobs:
98107 - name : Validate Gradle
99108 working-directory : ./example/android
100109 run : dart ../../scripts/check_gradle_version.dart
101- - name : Run all tests
110+ - name : Run all tests and coverage
102111 working-directory : ./example/android
103- run : ./gradlew :usercentrics_sdk:test
112+ run : ./gradlew :usercentrics_sdk:testDebugUnitTest :usercentrics_sdk:koverHtmlReportDebug
113+ - name : List coverage files
114+ working-directory : ./example
115+ run : find build -name "*.html" -o -name "index.html" | head -20
116+ - name : Upload coverage report
117+ uses : actions/upload-artifact@v4
118+ with :
119+ name : android-coverage-report
120+ path : example/build/usercentrics_sdk/reports/kover/htmlDebug
104121
105122 test-ios :
106123 name : Test iOS
107124 needs : [ lint, format, pub-dry-run ]
108- runs-on : macos-13
125+ runs-on : macos-14
109126 timeout-minutes : 20
110127
111128 steps :
112129 - name : Setup code
113130 uses : maxim-lobanov/setup-xcode@v1
114131 with :
115- xcode-version : ' 14.2 '
132+ xcode-version : ' 15.4 '
116133 - name : Checkout code
117134 uses : actions/checkout@v4
118135 - name : Setup Flutter
@@ -128,6 +145,9 @@ jobs:
128145 - name : Run all tests
129146 working-directory : ./example/ios
130147 run : ../../scripts/ios_unit_tests.sh
148+ - name : Show coverage report
149+ working-directory : ./example/ios
150+ run : xcrun xccov view --report TestResults.xcresult
131151
132152 build-android :
133153 name : Build Android Example
@@ -148,14 +168,14 @@ jobs:
148168 build-ios :
149169 name : Build iOS Example
150170 needs : [ lint, format, pub-dry-run ]
151- runs-on : macos-13
171+ runs-on : macos-14
152172 timeout-minutes : 20
153173
154174 steps :
155175 - name : Setup code
156176 uses : maxim-lobanov/setup-xcode@v1
157177 with :
158- xcode-version : ' 14.2 '
178+ xcode-version : ' 15.4 '
159179 - name : Checkout code
160180 uses : actions/checkout@v4
161181 - name : Setup Flutter
0 commit comments