From ee047d77dc91da7c8c85b3309827d2f707656fed Mon Sep 17 00:00:00 2001 From: Jac Date: Thu, 30 Jan 2025 15:52:01 -0800 Subject: [PATCH] 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 --- .github/workflows/check-coverage.yml | 13 +++++++------ README.md | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-coverage.yml b/.github/workflows/check-coverage.yml index 7d57137f..3d4996e4 100644 --- a/.github/workflows/check-coverage.yml +++ b/.github/workflows/check-coverage.yml @@ -5,6 +5,7 @@ on: pull_request: branches: - development + workflow_dispatch: jobs: build: @@ -12,7 +13,7 @@ jobs: 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 }} @@ -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: @@ -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 diff --git a/README.md b/README.md index 3390dffa..6afdf21a 100644 --- a/README.md +++ b/README.md @@ -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)