From 28ae7ddc2c9070cb90583da915b38a6b16e81d38 Mon Sep 17 00:00:00 2001 From: Plamen Valentinov Kolev Date: Fri, 15 Nov 2024 16:50:09 +0100 Subject: [PATCH] Add codecov to integration and unit --- .github/workflows/end_to_end.yml | 8 ++++++++ .github/workflows/unit.yml | 11 ++++++++--- .gitignore | 3 +++ tasks.py | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/end_to_end.yml b/.github/workflows/end_to_end.yml index 907e7be9..464d89e2 100644 --- a/.github/workflows/end_to_end.yml +++ b/.github/workflows/end_to_end.yml @@ -29,3 +29,11 @@ jobs: python -m pip install invoke .[test] - name: Run end to end tests run: invoke end-to-end + + - 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 a12d935a..49b0a821 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 - uses: codecov/codecov-action@v2 + + - 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 c702968d..555773eb 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,6 @@ ENV/ # tutorials tutorials/mymodel.pkl + +# Codecov +*_cov.xml diff --git a/tasks.py b/tasks.py index 2fbda22d..d2522cdf 100644 --- a/tasks.py +++ b/tasks.py @@ -34,12 +34,12 @@ def check_dependencies(c): @task def unit(c): - c.run('python -m pytest ./tests/unit --cov=copulas --cov-report=xml') + c.run('python -m pytest ./tests/unit --cov=copulas --cov-report=xml:./unit_cov.xml') @task def end_to_end(c): - c.run('python -m pytest ./tests/end-to-end --reruns 3') + c.run('python -m pytest ./tests/end-to-end --reruns 3 --cov=copulas --cov-report=xml:./integration_cov.xml') @task