diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 2d434621..680f48e4 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -25,8 +25,17 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Run unit tests - run: | - python panc/src/main/scripts/panlint/tests.py - - name: Produce coverage report run: | coverage run --source=panc/src/main/scripts/panlint --omit panc/src/main/scripts/panlint/tests.py panc/src/main/scripts/panlint/tests.py + - name: Report Coverage + env: + TERM: xterm + run: | + coverage report + coverage report --format=markdown >> $GITHUB_STEP_SUMMARY + # Produce a quick and dirty coloured annotation with numbered lines + coverage annotate + awk -v ln=1 '{printf("%4d %s\n", ln++, $0) }' panc/src/main/scripts/panlint/panlint.py,cover | + sed 's#^\( \+[[:digit:]]\+\) !#'"$(tput setaf 1)"'\1 !#' | + sed 's#^\( \+[[:digit:]]\+\) >#'"$(tput setaf 2)"'\1 >#' | + sed 's#^\( \+[[:digit:]]\+\) #'"$(tput setaf 7)"'\1 #'