Coder Social home page Coder Social logo

anksv / kover-report Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mi-kas/kover-report

0.0 1.0 0.0 1.52 MB

Github action that publishes the Kover code coverage report as a comment in pull requests

Home Page: https://github.com/marketplace/actions/kotlinx-kover-report

License: MIT License

Shell 0.29% JavaScript 0.69% TypeScript 99.02%

kover-report's Introduction

kover-report

Tests GitHub License Contributor Covenant

A Github action that publishes the Kover code coverage report as a comment in pull requests.

Usage

Pre-requisites

Create a workflow .yml file in your repositories .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

Inputs

  • path - [required string[]] List of paths to the generated kover report xml files
  • token - [required string] Github personal token to add commits to the pull request
  • title - [optional string] Title for the pull request comment
  • update-comment - [optional boolean (default: false)] Update the coverage report comment instead of creating a new one. Requires title to be set.
  • min-coverage-overall - [optional integer] The minimum code coverage that is required to pass for overall project
  • min-coverage-changed-files - [optional integer] The minimum code coverage that is required to pass for changed files
  • coverage-counter-type - [optional string (default: LINE)] Report counter type used to calculate coverage metrics. Possible values are: INSTRUCTION, LINE or BRANCH.

Outputs

  • coverage-overall - [integer] The overall coverage of the project
  • coverage-changed-files - [integer] The total coverage of all changed files

Example Workflow

name: Measure coverage

on:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up JDK
        uses: actions/setup-java@v3
        with:
          java-version: 11
      - name: Set up Gradle
        uses: gradle/gradle-build-action@v2
      - name: Generate kover coverage report
        run: ./gradlew koverXmlReport

      - name: Add coverage report to PR
        id: kover
        uses: mi-kas/kover-report@v1
        with:
          path: |
            ${{ github.workspace }}/project1/build/reports/kover/report.xml
            ${{ github.workspace }}/project2/build/reports/kover/report.xml
          token: ${{ secrets.GITHUB_TOKEN }}
          title: Code Coverage
          update-comment: true
          min-coverage-overall: 80
          min-coverage-changed-files: 80
          coverage-counter-type: LINE

output screenshot

Limitations

GitHub restricts the maximum permissions to read-only for personal access tokens for pull requests originating from a public forked repository (read more here). This prevents the default configuration of this action from successfully posting the report as a PR comment when using it on public repositories with limited permissions for users to create branches and therefore requiring them to create pull requests from forks.

Code of Conduct

Please read the full Code of Conduct so that you can understand what we expect project participants to adhere to and what actions will and will not be tolerated.

Thanks

Besides all the great open source software that is powering kover-report, special thanks also to JetBrains for making a open source development license available.

JetBrains logo

License

The scripts and documentation in this project are released under the MIT License.

kover-report's People

Contributors

dependabot[bot] avatar mi-kas avatar edwardstock avatar leocolman avatar nicholaslythall avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.