mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 11:46:32 +00:00
Improve test output and update action dependencies
This commit is contained in:
parent
6be16ea17d
commit
17ff13c0a1
5 changed files with 36 additions and 28 deletions
26
.github/workflows/android.yml
vendored
26
.github/workflows/android.yml
vendored
|
|
@ -9,9 +9,9 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
|
@ -23,14 +23,14 @@ jobs:
|
|||
- name: Run with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: assembleProdDebug -PdisablePreDex
|
||||
arguments: assembleProdDebug -PdisablePreDex --scan
|
||||
|
||||
unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
|
@ -42,7 +42,7 @@ jobs:
|
|||
- name: Run with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: testProdDebugUnitTest
|
||||
arguments: testProdDebugUnitTest --scan
|
||||
|
||||
# ui-test:
|
||||
# runs-on: macos-latest
|
||||
|
|
@ -73,9 +73,9 @@ jobs:
|
|||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
|
@ -87,14 +87,14 @@ jobs:
|
|||
- name: Run with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: ktlintCheck
|
||||
arguments: ktlintCheck --scan
|
||||
|
||||
detekt:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
|
@ -106,9 +106,9 @@ jobs:
|
|||
- name: Run with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: detekt
|
||||
arguments: detekt --scan
|
||||
- name: Upload SARIF to Github using the upload-sarif action
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
sarif_file: build/reports/detekt.sarif
|
||||
|
|
|
|||
|
|
@ -290,19 +290,6 @@ android {
|
|||
android.testOptions {
|
||||
unitTests.all {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed", "standardError"
|
||||
outputs.upToDateWhen {false}
|
||||
|
||||
afterSuite { desc, result ->
|
||||
if (!desc.parent) { // will match the outermost suite
|
||||
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
|
||||
def startItem = '| ', endItem = ' |'
|
||||
def repeatLength = startItem.length() + output.length() + endItem.length()
|
||||
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unitTests.returnDefaultValues = true
|
||||
}
|
||||
|
|
|
|||
20
build.gradle
20
build.gradle
|
|
@ -62,6 +62,22 @@ allprojects {
|
|||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed", "standardError"
|
||||
outputs.upToDateWhen {false}
|
||||
|
||||
afterSuite { desc, result ->
|
||||
if (!desc.parent) { // will match the outermost suite
|
||||
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
|
||||
def startItem = '| ', endItem = ' |'
|
||||
def repeatLength = startItem.length() + output.length() + endItem.length()
|
||||
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Properties props = new Properties()
|
||||
|
|
@ -110,4 +126,8 @@ tasks.named("detekt").configure {
|
|||
sarif.required.set(true)
|
||||
sarif.outputLocation.set(file("build/reports/detekt.sarif"))
|
||||
}
|
||||
}
|
||||
|
||||
task allUnitTests(type: GradleBuild) {
|
||||
tasks = [':Habitica:testProdDebugUnitTest', ':wearos:testProdDebugUnitTest', ':common:testProdDebugUnitTest', ':shared:testDebugUnitTest']
|
||||
}
|
||||
|
|
@ -5,4 +5,5 @@ org.gradle.configureondemand=true
|
|||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xmx6656M
|
||||
org.gradle.warning.mode=all
|
||||
kotlin.mpp.stability.nowarn=true
|
||||
kotlin.mpp.stability.nowarn=true
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
|
|
@ -29,7 +29,7 @@ kotlin {
|
|||
}
|
||||
}
|
||||
val androidMain by getting
|
||||
val androidTest by getting
|
||||
val androidUnitTest by getting
|
||||
val iosMain by getting
|
||||
val iosTest by getting
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue