Skip to content

Commit

Permalink
add jacoco report
Browse files Browse the repository at this point in the history
  • Loading branch information
Piasy committed Jan 11, 2025
1 parent e480d6c commit eebe387
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 32 deletions.
66 changes: 36 additions & 30 deletions .github/workflows/test_and_run_demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,48 @@ name: kmp-socketio build and test.

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
workflow_call:

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- cmd: "${GITHUB_WORKSPACE}/gradlew :kmp-socketio:jvmTest --info"
os: ubuntu-latest
dep: "cd ${GITHUB_WORKSPACE}/kmp-socketio/src/jvmTest/resources/ && npm install"
runs-on: ${{ matrix.os }}

runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: gradle/actions/setup-gradle@v3
- uses: actions/setup-node@v4
with:
node-version: 14
- if: ${{ matrix.dep }}
run: ${{ matrix.dep }}
- if: ${{ matrix.os == 'windows-latest' }}
shell: cmd
run: ${{ matrix.cmd }}
- if: ${{ matrix.os != 'windows-latest' }}
run: ${{ matrix.cmd }}
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "gradle"
- uses: gradle/actions/setup-gradle@v3
- uses: actions/setup-node@v4
with:
node-version: 14
- name: Setup Test Env
run: |
cd kmp-socketio/src/jvmTest/resources/
npm install
- name: Run Jvm tests
run: |
./gradlew :kmp-socketio:jvmTest --info
- name: Gen coverage
run: |
./gradlew koverXmlReport
- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
${GITHUB_WORKSPACE}/kmp-socketio/build/reports/kover/report.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ KMP (pure Kotlin) implementation of SocketIO client.
| `Browser` (Chrome) | 🚀 |
| `Android` | 🚀 |
| `iOS` | 🚀 |
| `MacOS` | 🚀 |
| `macOS` | 🚀 |
| `Windows X64` | 🚀 |
| `Linux X64` | 🔮 |

Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ kmp = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
versions = "com.github.ben-manes.versions:0.51.0"
versionUpdate = "nl.littlerobots.version-catalog-update:0.8.5"
vanniktech-mavenPublish = "com.vanniktech.maven.publish:0.30.0"
kover = "org.jetbrains.kotlinx.kover:0.9.1"
1 change: 1 addition & 0 deletions kmp-socketio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import com.vanniktech.maven.publish.SonatypeHost
plugins {
alias(libs.plugins.kmp)
alias(libs.plugins.vanniktech.mavenPublish)
alias(libs.plugins.kover)
}

version = Consts.releaseVersion
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginManagement {
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}

dependencyResolutionManagement {
Expand Down

0 comments on commit eebe387

Please sign in to comment.