Skip to content

Commit ee047d7

Browse files
authored
Add code coverage badge (#344)
* Add code coverage badge with coveralls.io * add manual trigger for workflow and cut to running on just one version of python
1 parent f44d56e commit ee047d7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/check-coverage.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ on:
55
pull_request:
66
branches:
77
- development
8+
workflow_dispatch:
89

910
jobs:
1011
build:
1112
strategy:
1213
fail-fast: false
1314
matrix:
1415
os: [ubuntu-latest]
15-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
16+
python-version: ['3.12']
1617

1718
runs-on: ${{ matrix.os }}
1819

@@ -38,6 +39,10 @@ jobs:
3839
- name: Generate coverage report
3940
run: pytest --junitxml=pytest.xml --cov=tabcmd tests/ | tee pytest-coverage.txt
4041

42+
# trying another coverage reporter for PRs/badges
43+
- name: Coveralls
44+
uses: coverallsapp/github-action@v2
45+
4146
- name: Comment on pull request with coverage
4247
uses: MishaKav/pytest-coverage-comment@main
4348
with:
@@ -46,10 +51,6 @@ jobs:
4651
# Error: The head commit for this pull_request event is not ahead of the base commit.
4752
# Please submit an issue on this action's GitHub repo
4853
# report-only-changed-files: true
49-
50-
# TODO update badge on readme:
51-
# generate badge with https://pypi.org/project/coverage-badge/
52-
# display it with https://github.com/Schneegans/dynamic-badges-action
53-
54+
5455
# TODO track docstring coverage
5556
# https://github.com/marketplace/actions/python-interrogate-check

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Tabcmd
22

33
[![Tableau Supported](https://img.shields.io/badge/Support%20Level-Tableau%20Supported-53bd92.svg)](https://www.tableau.com/support-levels-it-and-developer-tools)
4+
5+
[![Code coverage]([https://coveralls.io/repos/tableau/tabcmd/badge.png])(https://github.com/tableau/tabcmd/actions)
46
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
57
[![Python tests](https://github.com/tableau/tabcmd/actions/workflows/run-tests.yml/badge.svg)](https://github.com/tableau/tabcmd/actions/workflows/run-tests.yml)
68
[![Pypi smoke tests](https://github.com/tableau/tabcmd/actions/workflows/python-app.yml/badge.svg)](https://github.com/tableau/tabcmd/actions/workflows/python-app.yml)

0 commit comments

Comments
 (0)