forked from next-exp/IC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract coverage report into its own workflow
For now I keep the failure, to see how it works
- Loading branch information
1 parent
38d30af
commit da4a9fc
Showing
2 changed files
with
42 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow will install IC and run all the tests with pytest | ||
|
||
name: Test suite | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
check-coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get LFS files | ||
run: git lfs pull | ||
|
||
- name: Install IC | ||
run: | | ||
source $CONDA/etc/profile.d/conda.sh | ||
source manage.sh work_in_python_version_no_tests ${{ matrix.python-version }} | ||
- name: Produce coverage report | ||
run: | | ||
source $CONDA/etc/profile.d/conda.sh | ||
source manage.sh work_in_python_version_no_tests ${{ matrix.python-version }} | ||
coverage run -m pytest | ||
coverage report -m > coverage_report | ||
- name: Check coverage report | ||
run: | | ||
echo "Showing only files with coverage < 100%" | ||
head -2 coverage_report | ||
FAIL=0 | ||
incomplete_coverage=$(head -n -2 coverage_report | tail -n +3 | grep -v "100%") | ||
while read line; do | ||
FAIL=1 | ||
printf '\033[0;31m%s\033[0m\n' "$line" # red color ... reset color | ||
done <<<${incomplete_coverage} | ||
tail -2 coverage_report | ||
exit $FAIL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters