Coder Social home page Coder Social logo

pr-code-coverage-report-action's Introduction

PR Code Coverage Report Action

A GitHub action that adds a comment on PR that has the code coverage report

Note that this action will not execute any tests, it reads lcov coverage report generated by your test runner.

Example output

Total Coverage39.86%

Coverage Report
File Branches Funcs Lines
src
   index.js 17.48% 49.29% 28.51%
src/lib
   file1.js 74.19% 49.30% 35.82%
   file2.js 43.17% 20.48% 8.47%
   file3.js 85.71% 88.89% 83.19%
src/components
   main.js 62.64% 68.39% 20.73%
src/services
   service1.js 30.74% 51.84% 6.93%

Inputs

github-token (Required)

Github token used for posting the comment. To use the key provided by the GitHub action runner, use ${{ secrets.GITHUB_TOKEN }}.

lcov-file (Optional)

The location of the lcov file to read the coverage report from. Defaults to ./coverage/lcov.info.

lcov-base (Optional)

The location of the lcov file resulting from running the tests in the base branch. When this is set a diff of the coverage percentages is shown.

Usage

Create a workflow

name: 'PR Code Coverage Report Action'
on: 
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  task-check:
    runs-on: ubuntu-latest
    steps:
      - uses: venkatsarvesh/[email protected]
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

Acknowledgements

The initial code is based on ziishaned/jest-reporter-action.

📝 Licence

MIT

pr-code-coverage-report-action's People

Contributors

venkatsarvesh 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.