Skip to content

Commit c432c71

Browse files
authored
Merge pull request #1 from korlibs/soywiz/codecov.kover.binary.compatibility
Update template: codecov + kover + binary compatibility
2 parents 8e8db4e + 4de06e9 commit c432c71

File tree

5 files changed

+8490
-1
lines changed

5 files changed

+8490
-1
lines changed

.github/workflows/CODECOV.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CODECOV
2+
# https://docs.github.com/en/actions/learn-github-actions/expressions
3+
4+
on:
5+
push:
6+
branches: [ main, 'release/**' ]
7+
pull_request:
8+
branches: [ main, 'release/**' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
CI: true
16+
17+
JAVA_VERSION: 17
18+
JAVA_DISTRIBUTION: zulu
19+
20+
jobs:
21+
test:
22+
timeout-minutes: 30
23+
runs-on: ubuntu-latest
24+
steps:
25+
- { uses: actions/checkout@v4 }
26+
- { name: Use Node.js 20.x, uses: actions/setup-node@v4, with: { node-version: 20.x } }
27+
- { name: Setup Deno, uses: denoland/setup-deno@v1, with: { deno-version: "1.44.4" } }
28+
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
29+
- { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
30+
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
31+
- { name: Start gradle, run: ./gradlew }
32+
- { name: Code coverage, run: ./gradlew koverXmlReport }
33+
- name: Upload coverage reports to Codecov
34+
uses: codecov/[email protected]
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/TEST.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
#- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsNodeTest jsBrowserTest" }
3131
- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsBrowserTest jsDenoTest" }
3232
- { outputKey: testAndroid, os: ubuntu-latest, enableAndroid: true }
33-
- { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest }
33+
- { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest apiCheck }
3434
- { outputKey: testJvmLinux, os: ubuntu-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm, enableKotlinNative: true, enableSandbox: true, e2e: true }
3535
- { outputKey: testJvmWindows, os: windows-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm }
3636
#if: ${{ needs.changes.outputs[matrix.outputKey] == 'true' }}

build.gradle.kts

+7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import java.util.concurrent.*
1717
plugins {
1818
kotlin("multiplatform") version "2.0.0"
1919
id("com.android.library") version "8.2.2"
20+
id("org.jetbrains.kotlinx.kover") version "0.8.3" apply false
21+
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.2"
2022
id("org.jetbrains.dokka") version "1.9.20"
2123
`maven-publish`
2224
signing
@@ -1122,6 +1124,7 @@ allprojects {
11221124

11231125
subprojects {
11241126
plugins.apply("org.jetbrains.dokka")
1127+
plugins.apply("org.jetbrains.kotlinx.kover")
11251128
}
11261129

11271130
allprojects {
@@ -1130,3 +1133,7 @@ allprojects {
11301133
offlineMode.set(true)
11311134
}
11321135
}
1136+
1137+
apiValidation {
1138+
ignoredProjects.addAll(listOf(rootProject.name))
1139+
}

0 commit comments

Comments
 (0)