develop workflow for test coverage badge (#76)

Co-authored-by: Shiven Chawla <shivenchawla@microsoft.com>
This commit is contained in:
Shiven Chawla 2022-12-09 09:28:06 -08:00 коммит произвёл GitHub
Родитель e2acf81734
Коммит 165aa7afe0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 3064 добавлений и 0 удалений

35
.github/workflows/testcoverage.yaml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,35 @@
---
name: Generate PyTest Coverage Badge
on:
pull_request:
types:
- closed
jobs:
coverage_if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout Counterfit repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Get Coverage Percentage
id: coverage_percent
uses: notiz-dev/github-action-json-property@release
with:
path: 'coverage.json'
prop_path: 'totals.percent_covered_display'
- run: echo ${{steps.coverage_percent.outputs.prop}}
- name: Create Coverage Badge
uses: schneegans/dynamic-badges-action@v1.6.0
with:
auth: ${{ secrets.COUNTERFITGISTTOKEN }}
gistID: 67510f61f4c4c8809985712453ff1ad8
filename: counterfit_test_coverage_badge.json
label: Coverage
message: ${{steps.coverage_percent.outputs.prop}}%
color: orange

1
.gitignore поставляемый
Просмотреть файл

@ -46,6 +46,7 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml

Просмотреть файл

@ -1,6 +1,7 @@
# Counterfit
[![Tests](https://github.com/Azure/counterfit/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/Azure/counterfit/actions/workflows/tests.yaml)
![TestCoverageBadge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/shivenchawla/67510f61f4c4c8809985712453ff1ad8/raw/counterfit_test_coverage_badge.json)
[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/Azure/counterfit/blob/main/LICENSE)
[About](#About) | [Getting Started](#Getting-Started) | [Acknowledgments](#Acknowledgments) | [Contributing](#Contributing) | [Trademarks](#Trademarks) | [Contact Us](#Contact-Us)

3027
coverage.json Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу