GithubHelp home page GithubHelp logo

aessedai101 / jacoco-report Goto Github PK

View Code? Open in Web Editor NEW

This project forked from madrapps/jacoco-report

0.0 1.0 0.0 515 KB

Github action that publishes the JaCoCo report as a comment in the Pull Request

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

License: MIT License

JavaScript 100.00%

jacoco-report's Introduction

jacoco-report

Tests

Github action that publishes the JaCoCo report as a comment in the Pull Request

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

  • paths - [required] Whitespace separated paths of the generated xml files.
  • token - [required] Github personal token to add commits to Pull Request
  • min-coverage-overall - [optional] The minimum code coverage that is required to pass for changed files
  • min-coverage-changed-files - [optional] The minimum code coverage that is required to pass for changed files
  • comment-id - [optional] A comment to update if there is an existing comment

Outputs

  • coverage-overall - The overall coverage of the project
  • coverage-changed-files - 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@v2
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Run Coverage
        run: |
          chmod +x gradlew
          ./gradlew testCoverage

      - name: Add coverage to PR
        id: jacoco
        uses: madrapps/[email protected]
        with:
          paths: >
              ${{ github.workspace }}/build/reports/jacoco/testCoverage/testCoverage.xml
          token: ${{ secrets.GITHUB_TOKEN }}
          min-coverage-overall: 40
          min-coverage-changed-files: 60

Example Project

For a working project refer to jacoco-playgound project. Check out the PR's in the project to get an idea on how the report is shown on a pull request comment.

License

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

jacoco-report's People

Contributors

thsaravana avatar aessedai101 avatar

Watchers

James Cloos 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.