diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2c4b1261..ff8ff47e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -29,3 +29,11 @@ jobs: python -m pip install invoke .[test] - name: Run integration tests run: invoke integration + - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 + name: Upload integration codecov report + uses: codecov/codecov-action@v4 + with: + flags: integration + file: ${{ github.workspace }}/integration_cov.xml + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 8fcc3c77..0c24b31c 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -29,6 +29,11 @@ jobs: python -m pip install invoke .[test] - name: Run unit tests run: invoke unit - - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.8 - name: Upload codecov report + - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 + name: Upload unit codecov report uses: codecov/codecov-action@v4 + with: + flags: unit + file: ${{ github.workspace }}/unit_cov.xml + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 3bc5e457..90d339a1 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ coverage.xml *.cover .hypothesis/ .pytest_cache/ +*_cov.xml # Translations *.mo diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..a6441a11 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + precision: 2 + range: "90...100" + status: + project: + default: false + patch: + default: false diff --git a/tasks.py b/tasks.py index 7e0588b6..1280b3cd 100644 --- a/tasks.py +++ b/tasks.py @@ -25,12 +25,12 @@ def check_dependencies(c): @task def unit(c): - c.run('python -m pytest ./tests/unit --cov=sdgym --cov-report=xml') + c.run('python -m pytest ./tests/unit --cov=sdgym --cov-report=xml:./unit_cov.xml') @task def integration(c): - c.run('python -m pytest ./tests/integration') + c.run('python -m pytest ./tests/integration --cov=sdgym --cov-report=xml:./integration_cov.xml') @task