-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrates Android UI Tests to Robolectric-Instrumented Unit-Tests and …
…adds Coverage Reports (#21) * Migrates tests from android UI tests to instrumented unit tests * Adds coverage reporting and moves plugin-definition to version catalog * Drop unnecessary strategy for gha action * Setup-java 17 * Adds codecov badge
- Loading branch information
1 parent
6c81716
commit 09bafc6
Showing
18 changed files
with
135 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
unit_test: | ||
name: Run Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- name: Cache Gradle Files | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | ||
|
||
- name: Run Unit Tests | ||
run: ./gradlew scratchoff:testDebugUnitTest | ||
|
||
- name: Evaluate Test Report | ||
uses: mikepenz/[email protected] | ||
if: always() | ||
with: | ||
report_paths: 'scratchoff/build/test-results/testDebugUnitTest/TEST-*.xml' | ||
|
||
- name: Generate Coverage Report | ||
run: ./gradlew scratchoff:koverXmlReportDebug --stacktrace | ||
|
||
- name: Store Coverage Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: Test-Coverage | ||
path: scratchoff/build/reports/kover/reportDebug.xml | ||
|
||
report_test_coverage: | ||
needs: unit_test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: Test-Coverage | ||
|
||
- uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: reportDebug.xml | ||
flags: unit | ||
fail_ci_if_error: true | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[versions] | ||
agp = "8.2.0" | ||
kotlin = "1.9.21" | ||
kover = "0.7.5" | ||
|
||
[libraries] | ||
|
||
[plugins] | ||
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } | ||
androidApplication = { id = "com.android.application", version.ref = "agp" } | ||
androidLibrary = { id = "com.android.library", version.ref = "agp" } | ||
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenCentral() | ||
maven { url "https://maven.google.com/" } | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
include ':scratchoff', ':scratchoff-sample' |