Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 2 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
check:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 17
Expand All @@ -25,39 +25,3 @@ jobs:

- name: Build and test
run: ./gradlew :library:check

- name: Generate coverage report
run: ./gradlew :library:jvmTest :library:jacocoCoverageReport

- name: Parse coverage percentage
id: coverage
run: |
REPORT="library/build/reports/jacoco/jacocoCoverageReport/jacocoCoverageReport.xml"
if [ -f "$REPORT" ]; then
# JaCoCo: <counter type="LINE" missed="X" covered="Y"/> (last occurrence = project total)
LINE=$(grep 'type="LINE"' "$REPORT" | tail -1)
LINE_MISSED=$(echo "$LINE" | sed 's/.*missed="\([0-9]*\)".*/\1/')
LINE_COVERED=$(echo "$LINE" | sed 's/.*covered="\([0-9]*\)".*/\1/')
TOTAL=$((LINE_COVERED + LINE_MISSED))
if [ "$TOTAL" -gt 0 ]; then
PERCENT=$((LINE_COVERED * 100 / TOTAL))
else
PERCENT=0
fi
else
PERCENT=0
fi
echo "percentage=$PERCENT" >> "$GITHUB_OUTPUT"

- name: Update coverage badge
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ vars.COVERAGE_GIST_ID }}
filename: coverage.json
label: coverage
message: ${{ steps.coverage.outputs.percentage }}%
valColorRange: ${{ steps.coverage.outputs.percentage }}
minColorRange: 50
maxColorRange: 90
6 changes: 3 additions & 3 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 17
Expand All @@ -48,7 +48,7 @@ jobs:

- uses: actions/configure-pages@v5

- uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@v4
with:
path: _site

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# TreeLayoutKMP

[![CI](https://github.com/linde9821/TreeLayoutKMP/actions/workflows/ci.yml/badge.svg)](https://github.com/linde9821/TreeLayoutKMP/actions/workflows/ci.yml)
[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/linde9821/COVERAGE_GIST_ID/raw/coverage.json)](https://github.com/linde9821/TreeLayoutKMP/actions/workflows/ci.yml)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.linde9821/treelayout-kmp)](https://central.sonatype.com/artifact/io.github.linde9821/treelayout-kmp)

**[Live Demo](https://linde9821.github.io/TreeLayoutKMP/)** · *
**[Live Demo](https://linde9821.github.io/TreeLayoutKMP/)** ·
*[API Docs](https://linde9821.github.io/TreeLayoutKMP/api/)**

> ⚠️ **This library is under active development and has not reached a stable release yet.**
Expand Down
22 changes: 0 additions & 22 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ plugins {
alias(libs.plugins.android.kotlin.multiplatform.library)
alias(libs.plugins.vanniktech.mavenPublish)
alias(libs.plugins.dokka)
jacoco
}

group = "io.github.linde9821"
Expand Down Expand Up @@ -125,24 +124,3 @@ mavenPublishing {
}
}
}

tasks.named("jvmTest") {
finalizedBy("jacocoCoverageReport")
}

tasks.register<JacocoReport>("jacocoCoverageReport") {
dependsOn("jvmTest")
reports {
xml.required.set(true)
html.required.set(true)
}
classDirectories.setFrom(
fileTree("build/classes/kotlin/jvm/main")
)
sourceDirectories.setFrom(
files("src/commonMain/kotlin")
)
executionData.setFrom(
fileTree("build") { include("jacoco/jvmTest.exec") }
)
}
Loading