diff --git a/.github/workflows/ci_test-conda.yml b/.github/workflows/ci_test-conda.yml index 419580b71c..812d06f310 100644 --- a/.github/workflows/ci_test-conda.yml +++ b/.github/workflows/ci_test-conda.yml @@ -44,12 +44,30 @@ jobs: - name: Tests run: | # NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003 - python -m pytest pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml + python -m pytest pytorch_lightning tests --cov=pytorch_lightning -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml shell: bash -l {0} - - name: Upload pytest test results + - name: Upload pytest results uses: actions/upload-artifact@v2 with: name: pytest-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }} path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml if: failure() + + - name: Statistics + if: success() + run: | + coverage report + coverage xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + if: always() + # see: https://github.com/actions/toolkit/issues/399 + continue-on-error: true + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml + flags: cpu,pytest,torch${{ matrix.pytorch-version }} + name: CPU-coverage + fail_ci_if_error: false diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index dd29777d99..3d3f7d1157 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -138,13 +138,13 @@ jobs: - name: Tests run: | # NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003 - coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml + python -m pytest pytorch_lightning tests --cov=pytorch_lightning -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml - name: Examples run: | python -m pytest pl_examples -v --durations=10 - - name: Upload pytest test results + - name: Upload pytest results uses: actions/upload-artifact@v2 with: name: pytest-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }} @@ -165,6 +165,6 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} file: coverage.xml - flags: cpu,pytest + flags: cpu,pytest,python${{ matrix.python-version }} name: CPU-coverage fail_ci_if_error: false diff --git a/requirements/test.txt b/requirements/test.txt index 2d47143ca5..60c861cea9 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,7 +1,8 @@ -coverage>=5.0 +coverage>=5.2 codecov>=2.1 -pytest>=5.0 -# pytest-cov +pytest>=6.0 +pytest-cov>2.10 +pytest-xdist flake8>=3.6 check-manifest twine==3.2