Coder Social home page Coder Social logo

jethron / pytest-coverage-commentator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coroo/pytest-coverage-commentator

0.0 0.0 0.0 483 KB

A Github action to comments a Pytest Coverage on PR

License: MIT License

JavaScript 5.32% TypeScript 94.68%

pytest-coverage-commentator's Introduction

Pytest Coverage Commentator

A Github action to comments a Pytest Coverage on PR. Please note: this action only available on pull request.

GitHub Action

The following is an example GitHub Action workflow that uses the Pytest Coverage Commentator to extract the coverage to comment at pull request. Here is an example setup of this action:

# This workflow will install dependencies, create coverage tests and run Pytest Coverage Commentator
# For more information see: https://github.com/coroo/pytest-coverage-commentator
name: pytest-coverage-commentator
on:
  pull_request:
    branches: 
      - '*'
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install flake8 pytest pytest-cov
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
    - name: Build coverage file
      run: |
        pytest --cache-clear --cov=app test/ > pytest-coverage.txt
    - name: Comment coverage
      uses: coroo/[email protected]

Action Input

By default, action is designed to run with minimal configuration but you can alter Pytest Coverage Commentator using following action input:

Variable Default Purpose
pytest-coverage pytest-coverage.txt File conversion from pytest coverage. It will be used to create a comment.

You can see the action block with all variables as below:

    - name: pytest-coverage-commentator
      uses: coroo/[email protected]
      with:
        pytest-coverage: pytest-coverage.txt

Result Example

coverage-result

pytest-coverage-commentator's People

Contributors

coroo avatar dependabot[bot] 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.