diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d1ebafb..14bdf73 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -9,6 +9,9 @@ on: pull_request: branches: [ "master" ] +env: + PROJECT_NAME: diff_classifier + jobs: build: @@ -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 @@ -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