Skip to content

Commit

Permalink
Enable code coverage and codecov (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
skhugh authored Oct 5, 2022
1 parent 2bb4420 commit 1851bc6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: set up JDK 11
uses: actions/setup-java@v3
with:
Expand All @@ -22,5 +23,27 @@ jobs:

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Check with Gradle
run: ./gradlew check

- name: Run Jacoco
run: ./gradlew jacocoTestDebugUnitTestReport

- name: Generate report
uses: actions/upload-artifact@v2
with:
name: report
path: yorkie/build/jacoco

- name: Download Test Reports Folder
uses: actions/download-artifact@v2
with:
name: report
path: yorkie/build/jacoco

- name: Upload Test Report
uses: codecov/codecov-action@v2
with:
files: "yorkie/build/jacoco/jacoco.xml"

1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("org.jetbrains.kotlin.jvm") version "1.7.10" apply true
id("com.google.protobuf") version "0.8.18" apply false
id("org.jmailen.kotlinter") version "3.11.1" apply true
id("com.dicedmelon.gradle.jacoco-android") version "0.1.5" apply false
}

allprojects {
Expand Down
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"fixes": [
"/home/runner/work/yorkie-android-sdk/yorkie-android-sdk>/::"
],
"codecov": {
"disable_default_path_fixes": true
}
}
14 changes: 14 additions & 0 deletions yorkie/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ plugins {
id("com.android.library")
kotlin("android")
id("com.google.protobuf")
id("com.dicedmelon.gradle.jacoco-android")
}

jacoco {
toolVersion = "0.8.8"
}

android {
Expand All @@ -31,6 +36,9 @@ android {
}

buildTypes {
debug {
isTestCoverageEnabled = true
}
release {
isMinifyEnabled = false
proguardFiles(
Expand All @@ -47,6 +55,12 @@ android {
jvmTarget = JavaVersion.VERSION_11.toString()
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
}
jacocoAndroidUnitTestReport {
excludes = excludes + "**/dev/yorkie/api/v1/**"
csv.enabled(false)
xml.enabled(true)
html.enabled(false)
}
}

protobuf {
Expand Down

0 comments on commit 1851bc6

Please sign in to comment.