Skip to content

Commit

Permalink
Feat: add coverage comments to PRs (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Dec 6, 2023
2 parents 32f430a + 3f0e5bb commit 2cf865c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
steps:
- uses: actions/checkout@v4

Expand All @@ -30,3 +38,10 @@ jobs:
flask init-db
coverage run -m pytest
coverage report -m
- name: Coverage comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 90
MINIMUM_ORANGE: 80
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ line-length = 127
target-version = ['py311']
include = '\.pyi?$'

[tool.coverage.run]
branch = true
relative_files = true
source = ["eligibility_server"]

[tool.pyright]
include = ["eligibility_server", "tests"]

Expand Down

0 comments on commit 2cf865c

Please sign in to comment.