Skip to content

Commit

Permalink
Merge pull request #1541 from robstoll/codecov
Browse files Browse the repository at this point in the history
deactivate jacoco_additional until fix is found
  • Loading branch information
robstoll authored Sep 18, 2023
2 parents 7da8aa3 + 9db45dd commit 08ecd59
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ignore:
- "misc/specs"
- "misc/atrium-specs"
- "misc/tools"
- "samples"

Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ jobs:
- name: "build using jdk ${{ matrix.java_version }}"
run: ./gradlew build

- name: Upload build code coverage
uses: codecov/[email protected]
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}

with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: current
env_vars: JAVA_VERSION
# too many timeout errors, let's not fail at the moment
#fail_ci_if_error: true

- name: Cache android jar
id: android-cache
uses: actions/cache@v3
Expand All @@ -50,21 +61,11 @@ jobs:
- name: check Atrium's -jvm.jar can be dexed
run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer

# TODO 1.3.0 re-activate scala API
# TODO 1.5.0 re-activate scala API
# - name: composite build atrium-scala2
# run: ./gradlew build
# working-directory: misc/tools/atrium-scala2-test

- name: Upload build code coverage
uses: codecov/[email protected]
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}

with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: current
env_vars: JAVA_VERSION
# too many timeout errors, let's not fail at the moment
#fail_ci_if_error: true

- name: composite build atrium-samples-test
run: ./gradlew build
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
- name: "build using jdk ${{ matrix.java_version }}"
run: ./gradlew build

# TODO 1.5.0 re-activate scala API
# - name: composite build atrium-scala2
# run: ./gradlew build
# working-directory: misc\tools\atrium-scala2-test

- name: Upload windows build code coverage
uses: codecov/[email protected]
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
Expand All @@ -39,6 +34,11 @@ jobs:
# too many timeout errors, let's not fail at the moment
#fail_ci_if_error: true

# TODO 1.5.0 re-activate scala API
# - name: composite build atrium-scala2
# run: ./gradlew build
# working-directory: misc\tools\atrium-scala2-test

- name: composite build atrium-samples-test
run: ./gradlew build
working-directory: misc\tools\atrium-samples-test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BigDecimalExpectationsSpec : Spek({
@Suppress("DEPRECATION") fun1<BigDecimal?, BigDecimal?>(Expect<BigDecimal?>::toEqual).withNullableSuffix(),
fun1<BigDecimal?, Nothing?>(Expect<BigDecimal?>::toEqual).withNullableSuffix(),
Expect<Any>::toEqual,
@Suppress("DEPRECATION") Expect<BigDecimal>::notToEqual.name to @Suppress("DEPRECATION") Expect<BigDecimal>::notToEqual,
@Suppress("DEPRECATION") (Expect<BigDecimal>::notToEqual.name to Expect<BigDecimal>::notToEqual),
Expect<Any>::notToEqual,
Expect<BigDecimal>::toEqualNumerically.name to Expect<BigDecimal>::toEqualNumerically,
Expect<BigDecimal>::notToEqualNumerically.name to Expect<BigDecimal>::notToEqualNumerically,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,26 @@ plugins.withId("jacoco") {
toolVersion = jacocoToolVersion
}
}

//
val jacocoAdditionalExtraName = "jacocoAdditional"
tasks.withType<JacocoReport>()
.matching { it.name == "jacocoTestReport" }
.configureEach {
val coverageSourceDirs = arrayOf(
"src/commonMain",
"src/jvmMain"
)
//TODO 1.2.0 remove again, should be fixed in tutteli-gradle-plugins by now
sourceDirectories.from(project.files(coverageSourceDirs))
classDirectories.from(project.layout.buildDirectory.map { it.dir("classes/kotlin/jvm/main").asFileTree })

//TODO 1.2.0 translate to convention-plugin (or add to tutteli-plugin directly)
if (project.extra.has(jacocoAdditionalExtraName)) {
val additional = project.extra.get(jacocoAdditionalExtraName) as List<*>
additional.forEach { p ->
val otherProject = p as Project
val kotlin = otherProject.extensions
.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension>()
kotlin?.sourceSets?.filterNot { it.name.contains("Test") }?.forEach {
additionalSourceDirs(it.kotlin.sourceDirectories)
}
sourceDirectories.from(otherProject.files(coverageSourceDirs))
classDirectories.from(otherProject.layout.buildDirectory.map { it.dir("classes/kotlin/jvm/main").asFileTree })
}
}

Expand Down

0 comments on commit 08ecd59

Please sign in to comment.