Skip to content

Commit

Permalink
Add coverage report to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaponte committed Oct 28, 2024
1 parent ec63618 commit 8616d46
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,30 @@ jobs:
# - name: Fix Conda permissions on macOS
# run: sudo chown -R $UID $CONDA
# if: runner.os == 'macOS'

- name: Install IC
run: |
source $CONDA/etc/profile.d/conda.sh
source manage.sh work_in_python_version_no_tests ${{ matrix.python-version }}
- name: Run tests
# - name: Run tests
# run: |
# source $CONDA/etc/profile.d/conda.sh
# source manage.sh work_in_python_version_no_tests ${{ matrix.python-version }}
# PYTEST_ADDOPTS=--color=yes HYPOTHESIS_PROFILE=travis-ci bash manage.sh run_tests_par

- name: Check code coverage
run: |
source $CONDA/etc/profile.d/conda.sh
source manage.sh work_in_python_version_no_tests ${{ matrix.python-version }}
PYTEST_ADDOPTS=--color=yes HYPOTHESIS_PROFILE=travis-ci bash manage.sh run_tests_par
coverage run -m pytest invisible_cities/types
coverage report -m > coverage_report
echo "Showing only files with coverage < 100%"
head -2 coverage_report
FAIL=0
head -n -2 coverage_report | tail -n +3 | grep -v "100%" | while read line; do
FAIL=1
printf '\033[0;31m%s\033[0m' "$line" # red color ... reset color
done
tail -2 coverage_report
$FAIL

0 comments on commit 8616d46

Please sign in to comment.