Giter Club home page Giter Club logo

codacy-coverage-reporter-action's Introduction

Codacy Coverage Reporter GitHub Action

Codacy Badge

This GitHub Action uploads coverage reports to Codacy on all commits and pull requests, letting you track code coverage on the Codacy UI. After setting it up, you can optionally enable status checks on pull requests to avoid adding untested code or decreasing coverage.

Coverage metrics displayed on Codacy

Codacy is an automated code review tool that makes it easy to ensure your team is writing high-quality code by analyzing more than 40 programming languages such as PHP, JavaScript, Python, Java, and Ruby. Codacy allows you to define your own quality rules, code patterns and quality settings you'd like to enforce to prevent issues on your codebase.


Codacy


Uploading coverage to Codacy

Before setting up Codacy Coverage Reporter GitHub Action you must have tests and use tools to generate coverage reports for the source code files in your repository.

To upload coverage to Codacy using the GitHub Action using default settings:

  1. Set up an API token to allow the GitHub Action to authenticate on Codacy:

    โš ๏ธ Never write API tokens to your configuration files and keep your API tokens well protected, as they grant owner permissions to your projects on Codacy.

  2. Generate a supported code coverage report on each push to your repository.

  3. Add the following to a file .github/workflows/codacy-coverage-reporter.yaml in your repository, where PATH_TO_REPORT is the path to the coverage report:

    name: Codacy Coverage Reporter
    
    on: ["push"]
    
    jobs:
      codacy-coverage-reporter:
        runs-on: ubuntu-latest
        name: codacy-coverage-reporter
        steps:
          - uses: actions/checkout@v2
          - name: Run codacy-coverage-reporter
            uses: codacy/codacy-coverage-reporter-action@v1
            with:
              project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
              # or
              # api-token: ${{ secrets.CODACY_API_TOKEN }}
              coverage-reports: <PATH_TO_REPORT>
              # or a comma-separated list for multiple reports
              # coverage-reports: <PATH_TO_REPORT>, <PATH_TO_REPORT>
  4. Optionally, to add coverage results to GitHub status checks, configure a quality gate for coverage and enable sending status checks on Codacy.

Parameters

The Codacy GitHub Action is a wrapper for running the Codacy Coverage Reporter CLI and supports the following subset of parameters available for the command report:

Parameter Description Recommended value
project-token Project API token ${{ secrets.CODACY_PROJECT_TOKEN }}
api-token Account API token, an alternative to project-token when setting up multiple repositories ${{ secrets.CODACY_API_TOKEN }}
coverage-reports Optional path to the coverage report relative to the repository root, or a comma-separated list for multiple reports ''
language Optionally associate a language with your coverage report(s) ''
force-coverage-parser Optionally force using a specific coverage report parser ''

codacy-coverage-reporter-action's People

Contributors

arahaan avatar josemiguelmelo avatar lolgab avatar machadoit avatar mrfyda avatar nicklem avatar pedrocodacy avatar rtfpessoa 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.