Giter Site home page Giter Site logo

poowaa / github-actions-report-lcov Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zgosalvez/github-actions-report-lcov

0.0 1.0 0.0 432 KB

A Github Action to report the code coverage from LCOV files

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

License: MIT License

JavaScript 100.00%

github-actions-report-lcov's Introduction

GitHub Action โ€” Report LCOV

This GitHub Action (written in JavaScript) allows you to leverage GitHub Actions to report the code coverage from LCOV files. This action includes:

  • Generating an HTML report as an artifact
  • Commenting on a pull request (if the workflow was triggered by this event)
  • Failing if a minimum coverage is not met

Usage

Pre-requisites

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

Inputs

For more information on these inputs, see the Workflow syntax for GitHub Actions

  • coverage-files: The coverage files to scan. For example, coverage/lcov.*.info
  • artifact-name: The GitHub artifact name of the generated HTML report. For example, code-coverage-report. Note: When downloading, it will be extracted in an html directory
  • minimum-coverage: The minimum coverage to pass the check. Optional. Default: 0 (always passes)
  • github-token: Set the ${{ secrets.GITHUB_TOKEN }} token to have the action comment the coverage summary in the pull request. This token is provided by Actions, you do not need to create your own token. Optional. Default: ``
  • working-directory: The working directory containing the source files referenced in the LCOV files. Optional. Default: ./

Outputs

None.

Sample comment: Screenshot

Common workflow

on: pull_request

name: Continuous Integration

jobs:
  coverage_report:
    name: Generate coverage report
    needs: testing
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
    # ... Generate LCOV files or download it from a different job
    - name: Report code coverage
      uses: zgosalvez/github-actions-report-lcov@v1
      with:
        coverage-files: coverage/lcov.*.info
        minimum-coverage: 90
        artifact-name: code-coverage-report
        github-token: ${{ secrets.GITHUB_TOKEN }}
        working-directory: apps/my-first-app

Flutter Workflows

This is used in my opinionated GitHub Actions: Flutter Workflows repository along with other actions for a complete end-to-end DevOps experience.

License

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

github-actions-report-lcov's People

Contributors

dependabot[bot] avatar jbrownsw avatar moseskarunia avatar zgosalvez 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.