Skip to content

Commit 2cf865c

Browse files
authored
Feat: add coverage comments to PRs (#379)
2 parents 32f430a + 3f0e5bb commit 2cf865c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/run-tests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ on:
88
jobs:
99
tests:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
# Gives the action the necessary permissions for publishing new
13+
# comments in pull requests.
14+
pull-requests: write
15+
# Gives the action the necessary permissions for pushing data to the
16+
# python-coverage-comment-action branch, and for editing existing
17+
# comments (to avoid publishing multiple comments in the same PR)
18+
contents: write
1119
steps:
1220
- uses: actions/checkout@v4
1321

@@ -30,3 +38,10 @@ jobs:
3038
flask init-db
3139
coverage run -m pytest
3240
coverage report -m
41+
42+
- name: Coverage comment
43+
uses: py-cov-action/python-coverage-comment-action@v3
44+
with:
45+
GITHUB_TOKEN: ${{ github.token }}
46+
MINIMUM_GREEN: 90
47+
MINIMUM_ORANGE: 80

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ line-length = 127
4141
target-version = ['py311']
4242
include = '\.pyi?$'
4343

44+
[tool.coverage.run]
45+
branch = true
46+
relative_files = true
47+
source = ["eligibility_server"]
48+
4449
[tool.pyright]
4550
include = ["eligibility_server", "tests"]
4651

0 commit comments

Comments
 (0)