Skip to content

Commit 549d660

Browse files
committed
Report coverage at end of tests
1 parent 73b0bd3 commit 549d660

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/python.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77

88
runs-on: ubuntu-latest
99

10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
1014
steps:
1115
- uses: actions/checkout@v4
1216
- name: Set up Python 3.9
@@ -25,8 +29,16 @@ jobs:
2529
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
2630
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
2731
- name: Run unit tests
28-
run: |
29-
python panc/src/main/scripts/panlint/tests.py
30-
- name: Produce coverage report
3132
run: |
3233
coverage run --source=panc/src/main/scripts/panlint --omit panc/src/main/scripts/panlint/tests.py panc/src/main/scripts/panlint/tests.py
34+
- name: Report Coverage
35+
env:
36+
TERM: xterm
37+
run: |
38+
coverage report
39+
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
40+
# Produce a quick and dirty coloured annotation
41+
coverage annotate
42+
sed 's#^!#'"$(tput setaf 1)"'!#' panc/src/main/scripts/panlint/panlint.py,cover |
43+
sed 's#^>#'"$(tput setaf 2)"'>#' |
44+
sed 's#^\([^\\]\)#'"$(tput setaf 7)"'\1#'

0 commit comments

Comments
 (0)