diff --git a/.github/workflows/CODECOV.yml b/.github/workflows/CODECOV.yml new file mode 100644 index 0000000..08a5cc7 --- /dev/null +++ b/.github/workflows/CODECOV.yml @@ -0,0 +1,36 @@ +name: CODECOV +# https://docs.github.com/en/actions/learn-github-actions/expressions + +on: + push: + branches: [ main, 'release/**' ] + pull_request: + branches: [ main, 'release/**' ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + CI: true + + JAVA_VERSION: 17 + JAVA_DISTRIBUTION: zulu + +jobs: + test: + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - { uses: actions/checkout@v4 } + - { name: Use Node.js 20.x, uses: actions/setup-node@v4, with: { node-version: 20.x } } + - { name: Setup Deno, uses: denoland/setup-deno@v1, with: { deno-version: "1.44.4" } } + - { 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" } + - { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } } + - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0 + - { name: Start gradle, run: ./gradlew } + - { name: Code coverage, run: ./gradlew koverXmlReport } + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/TEST.yml b/.github/workflows/TEST.yml index 4e5caa9..56feda5 100644 --- a/.github/workflows/TEST.yml +++ b/.github/workflows/TEST.yml @@ -30,7 +30,7 @@ jobs: #- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsNodeTest jsBrowserTest" } - { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsBrowserTest jsDenoTest" } - { outputKey: testAndroid, os: ubuntu-latest, enableAndroid: true } - - { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest } + - { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest apiCheck } - { outputKey: testJvmLinux, os: ubuntu-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm, enableKotlinNative: true, enableSandbox: true, e2e: true } - { outputKey: testJvmWindows, os: windows-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm } #if: ${{ needs.changes.outputs[matrix.outputKey] == 'true' }} diff --git a/build.gradle.kts b/build.gradle.kts index 6e98412..65e859a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,8 @@ import java.util.concurrent.* plugins { kotlin("multiplatform") version "2.0.0" id("com.android.library") version "8.2.2" + id("org.jetbrains.kotlinx.kover") version "0.8.3" apply false + id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.2" id("org.jetbrains.dokka") version "1.9.20" `maven-publish` signing @@ -1122,6 +1124,7 @@ allprojects { subprojects { plugins.apply("org.jetbrains.dokka") + plugins.apply("org.jetbrains.kotlinx.kover") } allprojects { @@ -1130,3 +1133,7 @@ allprojects { offlineMode.set(true) } } + +apiValidation { + ignoredProjects.addAll(listOf(rootProject.name)) +} diff --git a/korlibs-simple/api/android/korlibs-simple.api b/korlibs-simple/api/android/korlibs-simple.api new file mode 100644 index 0000000..38fde02 --- /dev/null +++ b/korlibs-simple/api/android/korlibs-simple.api @@ -0,0 +1,4 @@ +public final class korlibs/simple/Simple { + public fun ()V +} + diff --git a/korlibs-simple/api/jvm/korlibs-simple.api b/korlibs-simple/api/jvm/korlibs-simple.api new file mode 100644 index 0000000..38fde02 --- /dev/null +++ b/korlibs-simple/api/jvm/korlibs-simple.api @@ -0,0 +1,4 @@ +public final class korlibs/simple/Simple { + public fun ()V +} +