diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml index a1c9875..0f85e4d 100644 --- a/.github/workflows/publish-to-pypi.yaml +++ b/.github/workflows/publish-to-pypi.yaml @@ -21,11 +21,34 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pytest - - name: Run tests + - name: Run tests with pytest run: | - pytest tests/ + pytest tests/ --junitxml=tests/test-results.xml --tb=long -vv --cov=./ --cov-report=xml:tests/coverage.xml + + continue-on-error: true + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results + path: tests/test-results.xml + + - name: Upload coverage results + if: always() + uses: actions/upload-artifact@v3 + with: + name: coverage-results + path: tests/coverage.xml + + - name: Annotate the test results + if: failure() + uses: dorny/test-reporter@v1 + with: + name: Pytest + path: tests/test-results.xml + reporter: pytest build: name: Build distribution 📦 runs-on: ubuntu-latest diff --git a/requirements.txt b/requirements.txt index 452208b..f4eece2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,4 +12,5 @@ pytest>=8.2.2 python-dateutil>=2.8.0 free-proxy>=1.1.1 Jinja2==3.1.4 -PyYAML==5.3.1 \ No newline at end of file +PyYAML==5.3.1 +pytest-cov==5.0.0 \ No newline at end of file