Skip to content

Commit

Permalink
Add code coverage badge (#344)
Browse files Browse the repository at this point in the history
* Add code coverage badge with coveralls.io

* add manual trigger for workflow and cut to running on just one version of python
  • Loading branch information
jacalata authored Jan 30, 2025
1 parent f44d56e commit ee047d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ on:
pull_request:
branches:
- development
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ['3.12']

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

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

# trying another coverage reporter for PRs/badges
- name: Coveralls
uses: coverallsapp/github-action@v2

- name: Comment on pull request with coverage
uses: MishaKav/pytest-coverage-comment@main
with:
Expand All @@ -46,10 +51,6 @@ jobs:
# Error: The head commit for this pull_request event is not ahead of the base commit.
# Please submit an issue on this action's GitHub repo
# report-only-changed-files: true

# TODO update badge on readme:
# generate badge with https://pypi.org/project/coverage-badge/
# display it with https://github.com/Schneegans/dynamic-badges-action


# TODO track docstring coverage
# https://github.com/marketplace/actions/python-interrogate-check
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Tabcmd

[![Tableau Supported](https://img.shields.io/badge/Support%20Level-Tableau%20Supported-53bd92.svg)](https://www.tableau.com/support-levels-it-and-developer-tools)

[![Code coverage]([https://coveralls.io/repos/tableau/tabcmd/badge.png])(https://github.com/tableau/tabcmd/actions)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Python tests](https://github.com/tableau/tabcmd/actions/workflows/run-tests.yml/badge.svg)](https://github.com/tableau/tabcmd/actions/workflows/run-tests.yml)
[![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)
Expand Down

0 comments on commit ee047d7

Please sign in to comment.