Skip to content

Commit

Permalink
codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
nlsschim committed Apr 23, 2024
1 parent 161c0ad commit 149bef9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
branches: [ "master" ]

env:
PROJECT_NAME: diff_classifier

jobs:
build:

Expand All @@ -27,7 +30,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest coverage
python -m pip install flake8 pytest pytest-cov coverage
pip install -e .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
Expand All @@ -38,11 +41,7 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest and coverage
run: |
coverage run -m pytest
coverage report -m
coverage report -m --fail-under=50 --skip-covered
COVERAGE_PERCENT=$(coverage report -m --skip-covered | awk '/TOTAL/ { print $4 }' | sed 's/%$//' | awk '{ printf "%d\n", $1 }')
echo "COVERAGE_PERCENT=${COVERAGE_PERCENT}" >> $GITHUB_ENV
pytest -vvv -cov=${{ env.PROJECT_NAME }} --cov-report=xml --cov-report=term diff_classifier/tests/
- name: Save coverage report as an artifact
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 149bef9

Please sign in to comment.