From 0d14d03f47a52519b21e986c97ef39443fa55d07 Mon Sep 17 00:00:00 2001 From: Vinit Kumar Date: Sun, 22 Sep 2024 01:05:25 +0530 Subject: [PATCH] feat: add ability for codecov to get test healthiness --- .github/workflows/pythonpackage.yml | 21 +++++++++++---------- .gitignore | 1 + requirements-dev.txt | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index d10ab75..9c149c3 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -42,13 +42,14 @@ jobs: pip install --upgrade -r requirements-dev.txt pip install . - name: Unit tests - run: | - coverage run -m pytest - coverage xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true # optional (default = false) - name: codecov-umbrella # optional - token: ${{ secrets.CODECOV_TOKEN }} # required - verbose: true # optional (default = false) + run: | + pytest --cov --junitxml=junit.xml + - name: Upload coverage 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/.gitignore b/.gitignore index 95c0bea..da550e9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ dist/* venv .vscode tests/*.ipynb +junit.xml diff --git a/requirements-dev.txt b/requirements-dev.txt index 6af2c5c..303416e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,6 +2,7 @@ -r requirements.in xmltodict>=0.12.0 pytest +pytest-cov coverage py flake8