From db9d0880653072e80a647b840c028323ae9c65f0 Mon Sep 17 00:00:00 2001 From: Plamen Valentinov Kolev Date: Fri, 15 Nov 2024 16:50:09 +0100 Subject: [PATCH 1/3] 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 From fcbd2935a02cbd843ffac05857ffa62b59ef7d20 Mon Sep 17 00:00:00 2001 From: Plamen Valentinov Kolev Date: Mon, 18 Nov 2024 08:28:41 +0100 Subject: [PATCH 2/3] Update git ignore --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 555773eb..9f2f0274 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ coverage.xml *.cover .hypothesis/ .pytest_cache/ +*_cov.xml # Translations *.mo @@ -114,6 +115,3 @@ ENV/ # tutorials tutorials/mymodel.pkl - -# Codecov -*_cov.xml From 22c7cca339c08dd32d540bd03bc619ccc9c58673 Mon Sep 17 00:00:00 2001 From: Plamen Valentinov Kolev Date: Mon, 18 Nov 2024 17:30:58 +0100 Subject: [PATCH 3/3] Add workspace and fail ci --- .github/workflows/end_to_end.yml | 5 +++-- .github/workflows/unit.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/end_to_end.yml b/.github/workflows/end_to_end.yml index 464d89e2..c00ba1b7 100644 --- a/.github/workflows/end_to_end.yml +++ b/.github/workflows/end_to_end.yml @@ -30,10 +30,11 @@ jobs: - name: Run end to end tests run: invoke end-to-end - - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 + - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 name: Upload integration codecov report uses: codecov/codecov-action@v4 with: flags: integration - file: './integration_cov.xml' + 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 49b0a821..4ee8b36a 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -30,10 +30,11 @@ jobs: - name: Run unit tests run: invoke unit - - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 + - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12 name: Upload unit codecov report uses: codecov/codecov-action@v4 with: flags: unit - file: './unit_cov.xml' + file: ${{ github.workspace }}/unit_cov.xml + fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }}