From 7ef36b3f399c8c96548c30a8ce6f85f227de3b63 Mon Sep 17 00:00:00 2001 From: Vlad Korolev Date: Wed, 28 Aug 2024 13:53:07 -0400 Subject: [PATCH] Add coverage step --- .github/workflows/python.yml | 28 +++++++++++++++++++++++++++- pyproject.toml | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 281d85f..8b5fed4 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -33,7 +33,33 @@ jobs: with: python-version: 3.12 cache: pip - - name: Install Nox and group dependencies + - name: Install dev group dependencies run: pip install '.[dev]' - name: Test with Nox run: nox -s mypy-3.12 + coverage: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: pip + - name: Install dev group dependencies + run: pip install '.[dev]' + - name: Install package in place + run: pip install -e . + # We are not testing with Nox because Nox / Pytest / Coverage and CodeCov + # have a weird cross interaction. It doesn't matter for us anyway because we use only + - name: Test with py test + run: pytest -n auto --cov --junitxml=junit.xml + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 020e7d2..eb94673 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ dev = [ "pytest==8.3.2", "pytest-cov==5.0.0", "pytest_sugar==1.0.0", + "pytest-xdist==3.6.1", "xsdata[cli]==24.7", "ruff==0.5.5" ]