From fc5070ffda9b9653c671892ba1e67d0901b9aae2 Mon Sep 17 00:00:00 2001 From: Eugenio Lacuesta Date: Wed, 16 Dec 2020 18:16:48 -0300 Subject: [PATCH] Upload coverage report from CI --- .github/workflows/main.yml | 8 ++++++++ tox.ini | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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