diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfc171f..911a191 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,8 +33,19 @@ jobs: name: test-report path: gridkit-core/build/reports/tests/test/ - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + - name: Generate coverage badge + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + uses: cicirello/jacoco-badge-generator@v2 with: - files: gridkit-core/build/reports/jacoco/test/jacocoTestReport.xml - fail_ci_if_error: false + jacoco-csv-file: gridkit-core/build/reports/jacoco/test/jacocoTestReport.csv + badges-directory: .github/badges + generate-branches-badge: true + + - name: Commit coverage badge + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git add .github/badges/ || true + git diff --cached --quiet || git commit -m "chore: update coverage badge [skip ci]" + git push diff --git a/CLAUDE.md b/AGENTS.md similarity index 100% rename from CLAUDE.md rename to AGENTS.md diff --git a/README.md b/README.md index 53ba880..f917948 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![GridKit Logo](GridKit.png) [![CI](https://github.com/tolikttaaa/GridKit/actions/workflows/ci.yml/badge.svg)](https://github.com/tolikttaaa/GridKit/actions/workflows/ci.yml) -[![codecov](https://codecov.io/gh/tolikttaaa/GridKit/graph/badge.svg?token=R1E33N9QTK)](https://codecov.io/gh/tolikttaaa/GridKit) +[![Coverage](.github/badges/jacoco.svg)](gridkit-core/build/reports/jacoco/test/index.html) A Kotlin library providing a unified abstraction layer for tile-based game boards. GridKit supports square, hexagonal, and triangular grid topologies through a single, diff --git a/gridkit-core/build.gradle.kts b/gridkit-core/build.gradle.kts index 59ce346..bd36983 100644 --- a/gridkit-core/build.gradle.kts +++ b/gridkit-core/build.gradle.kts @@ -16,6 +16,7 @@ tasks.jacocoTestReport { dependsOn(tasks.test) reports { xml.required = true + csv.required = true html.required = true } }