From 3c2ee5c5ed381f40247d9132c6144e4df4dc4c89 Mon Sep 17 00:00:00 2001 From: Plamen Valentinov Kolev Date: Fri, 15 Nov 2024 16:56:21 +0100 Subject: [PATCH] Add codecov to tests --- .github/workflows/integration.yml | 8 ++++++++ .github/workflows/unit.yml | 8 ++++++++ .gitignore | 3 +++ tasks.py | 4 ++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2f3f7c98..dda33272 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.9 + name: Upload integration codecov report + uses: codecov/codecov-action@v4 + with: + flags: integration + file: './integration_cov.xml' + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 4345632e..553ca4f7 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -29,3 +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.9 + name: Upload unit codecov report + uses: codecov/codecov-action@v4 + with: + flags: unit + file: './unit_cov.xml' + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 1609a70e..00f56f8d 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,6 @@ ENV/ # Vim .*.swp + +# Codecov +*_cov.xml diff --git a/tasks.py b/tasks.py index 0dbd139a..c55bd0df 100644 --- a/tasks.py +++ b/tasks.py @@ -24,12 +24,12 @@ def check_dependencies(c): @task def unit(c): - c.run('python -m pytest ./tests/unit --cov=ctgan --cov-report=xml') + c.run('python -m pytest ./tests/unit --cov=ctgan --cov-report=xml:./unit_cov.xml') @task def integration(c): - c.run('python -m pytest ./tests/integration --reruns 3') + c.run('python -m pytest ./tests/integration --reruns 3 --cov=ctgan --cov-report=xml:./integration_cov.xml') @task