diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index edc70bbc..2bb72dff 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest + python -m pip install flake8 pytest pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | @@ -35,3 +35,13 @@ jobs: - name: Test with pytest run: | python -m pytest + - name: Generate coverage report + run: | + python -m pytest --cov=./ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + # token: ${{ secrets.CODECOV_TOKEN }} # not needed for public repos + flags: unittests + fail_ci_if_error: true + verbose: true