ci: add Codecov coverage upload and XML report generation (#579)
## Add Codecov coverage upload and XML report generation - Add `koverXmlReport` to Gradle tasks in Ubuntu workflow - Configure Codecov action to upload coverage reports Reports will be available on https://app.codecov.io/gh/modelcontextprotocol/kotlin-sdk ## Motivation and Context To provide better test coverage visibility ## How Has This Been Tested? CI ## Breaking Changes No ## Types of changes - [x] CI update ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context <!-- Add any other context, implementation notes, or design decisions -->
This commit is contained in:
parent
45fcc17a23
commit
c36881282f
3 changed files with 72 additions and 1 deletions
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
|
|
@ -36,7 +36,7 @@ jobs:
|
|||
include:
|
||||
- os: ubuntu-latest
|
||||
job-name: "Linux Tests"
|
||||
gradle-tasks: "build ktlintCheck koverLog koverHtmlReport publishToMavenLocal -Pversion=1-SNAPSHOT"
|
||||
gradle-tasks: "build ktlintCheck koverLog koverHtmlReport koverXmlReport publishToMavenLocal -Pversion=1-SNAPSHOT"
|
||||
max-workers: 3
|
||||
|
||||
- os: windows-latest
|
||||
|
|
@ -107,6 +107,24 @@ jobs:
|
|||
report_paths: '**/test-results/**/TEST-*.xml'
|
||||
truncate_stack_traces: false
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
directory: ./build/reports/kover
|
||||
files: report.xml
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
if: ${{ !cancelled() && matrix.os == 'ubuntu-latest' }}
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
directory: ./build/reports/kover
|
||||
files: report.xml
|
||||
|
||||
- name: Upload test results to Codecov
|
||||
if: ${{ !cancelled() && matrix.os == 'ubuntu-latest' }}
|
||||
uses: codecov/test-results-action@v1
|
||||
|
||||
- name: Archive Maven Local Repository
|
||||
if: ${{ success() && matrix.os == 'ubuntu-latest' }}
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
[](https://central.sonatype.com/artifact/io.modelcontextprotocol/kotlin-sdk)
|
||||
[](https://github.com/modelcontextprotocol/kotlin-sdk/actions/workflows/build.yml)
|
||||
[](https://github.com/modelcontextprotocol/kotlin-sdk/actions/workflows/conformance.yml)
|
||||
[](https://codecov.io/github/modelcontextprotocol/kotlin-sdk)
|
||||
|
||||
[](http://kotlinlang.org)
|
||||
[](https://kotlinlang.org/docs/multiplatform.html)
|
||||
[](http://java.com)
|
||||
|
|
|
|||
51
codecov.yml
Normal file
51
codecov.yml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# Codecov configuration for Mokksy and AI-Mocks
|
||||
# https://docs.codecov.com/docs/codecov-yaml
|
||||
|
||||
codecov:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
patch:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
|
||||
comment:
|
||||
layout: "header, diff, flags, components"
|
||||
behavior: default
|
||||
require_changes: true
|
||||
|
||||
component_management:
|
||||
default_rules:
|
||||
statuses:
|
||||
- type: project
|
||||
target: auto
|
||||
individual_components:
|
||||
|
||||
- component_id: kotlin-sdk-core
|
||||
name: SDK Core
|
||||
paths:
|
||||
- kotlin-sdk-core/**
|
||||
|
||||
- component_id: kotlin-sdk-client
|
||||
name: SDK Client
|
||||
paths:
|
||||
- kotlin-sdk-client/**
|
||||
|
||||
- component_id: kotlin-sdk-server
|
||||
name: SDK Server
|
||||
paths:
|
||||
- kotlin-sdk-server/**
|
||||
|
||||
- component_id: kotlin-sdk-testing
|
||||
name: SDK Testing
|
||||
paths:
|
||||
- kotlin-sdk-testing/**
|
||||
|
||||
Loading…
Reference in a new issue