Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ jobs:
- name: Run Tests
run: yarn test

- name: Upload coverage reports
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/

- name: Assert that every file that should be public has been exported
run: ./scripts/assert_export.sh

Expand Down Expand Up @@ -99,9 +106,28 @@ jobs:
-scheme "sample" \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 16 Pro' \
-enableCodeCoverage YES \
-resultBundlePath TestResults.xcresult \
-only-testing:sampleTests \
test | bundle exec xcpretty && exit ${PIPESTATUS[0]}

- name: Install Slather
run: gem install slather

- name: Generate iOS HTML Report
working-directory: ./sample/ios
run: |
slather coverage --html --output-directory html-report --scheme sample --workspace sample.xcworkspace sample.xcodeproj

- name: Upload iOS coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-coverage
path: |
sample/ios/TestResults.xcresult
sample/ios/html-report/

test-android:
needs: test-rn
runs-on: macOS-14
Expand Down Expand Up @@ -134,4 +160,11 @@ jobs:

- name: Run SDK Unit Tests
working-directory: ./sample/android
run: ./gradlew :react-native-usercentrics:test
run: ./gradlew :react-native-usercentrics:koverXmlReport :react-native-usercentrics:koverHtmlReport

- name: Upload Android coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: android-coverage
path: android/build/reports/kover/
6 changes: 6 additions & 0 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ val isHermesEnabled = BooleanProperty("hermesEnabled")
plugins {
id("com.android.library")
id("kotlin-android")
id("org.jetbrains.kotlinx.kover") version "0.9.1"
}

if (isNewArchitectureEnabled) {
Expand All @@ -37,6 +38,11 @@ android {

}

buildTypes {
getByName("debug") {
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@
"jsx",
"json",
"node"
],
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{ts,tsx}",
"!src/**/*.d.ts"
],
"coverageDirectory": "coverage",
"coverageReporters": [
"text",
"lcov"
]
},
"directories": {
Expand Down