diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6379d1b1b..ce31ed441 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -106,6 +106,7 @@ jobs: tox - name: Run check (ubuntu) + id: ubuntu-tests if: startsWith(matrix.os, 'ubuntu') env: ${{ matrix.env }} run: | @@ -118,6 +119,13 @@ jobs: fi pip install -U tox tox + if [ -f "coverage.xml" ]; then + echo ::set-output name=upload_coverage_report::true + fi + + - name: Upload coverage report + if: steps.ubuntu-tests.outputs.upload_coverage_report == 'true' + run: bash <(curl -s https://codecov.io/bash) publish: name: "Publish package to PyPI" diff --git a/tox.ini b/tox.ini index 1a9d5b5c3..aef196a93 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ passenv = #allow tox virtualenv to upgrade pip/wheel/setuptools download = true commands = - py.test --cov=scrapy --cov-report= {posargs:--durations=10 docs scrapy tests} + py.test --cov=scrapy --cov-report=xml --cov-report= {posargs:--durations=10 docs scrapy tests} [testenv:typing] basepython = python3