Skip to content

Commit 149bef9

Browse files
committed
codecov
1 parent 161c0ad commit 149bef9

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
pull_request:
1010
branches: [ "master" ]
1111

12+
env:
13+
PROJECT_NAME: diff_classifier
14+
1215
jobs:
1316
build:
1417

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

0 commit comments

Comments
 (0)