зеркало из https://github.com/Azure/counterfit.git
develop workflow for test coverage badge (#76)
Co-authored-by: Shiven Chawla <shivenchawla@microsoft.com>
This commit is contained in:
Родитель
e2acf81734
Коммит
165aa7afe0
|
@ -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
|
|
@ -46,6 +46,7 @@ pip-delete-this-directory.txt
|
||||||
# Unit test / coverage reports
|
# Unit test / coverage reports
|
||||||
htmlcov/
|
htmlcov/
|
||||||
.tox/
|
.tox/
|
||||||
|
.coverage
|
||||||
.coverage.*
|
.coverage.*
|
||||||
.cache
|
.cache
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# Counterfit
|
# Counterfit
|
||||||
|
|
||||||
[![Tests](https://github.com/Azure/counterfit/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/Azure/counterfit/actions/workflows/tests.yaml)
|
[![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)
|
[![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)
|
[About](#About) | [Getting Started](#Getting-Started) | [Acknowledgments](#Acknowledgments) | [Contributing](#Contributing) | [Trademarks](#Trademarks) | [Contact Us](#Contact-Us)
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче