feat: added code coverage reporting (#9081)

* added code coverage reporting

* fix issues

* more cleanup

* fix action configs

* cleanup token debug

* added comments to codecov.yml config

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
This commit is contained in:
Eric Pinzur 2025-07-21 10:03:34 -04:00 committed by GitHub
commit 65a977cba2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 128 additions and 1 deletions

View file

@ -7,6 +7,8 @@ on:
required: true
ANTHROPIC_API_KEY:
required: true
CODECOV_TOKEN:
required: false
inputs:
python-versions:
description: "(Optional) Python versions to test"
@ -50,11 +52,13 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
id: setup-node
with:
node-version: ${{ env.NODE_VERSION }}
- name: "Setup Environment"
uses: astral-sh/setup-uv@v6
with:
@ -62,15 +66,37 @@ jobs:
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}
prune-cache: false
- name: Install the project
run: uv sync
- name: Run unit tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 12
max_attempts: 2
command: make unit_tests args="-x -vv --splits ${{ matrix.splitCount }} --group ${{ matrix.group }} --reruns 5"
command: make unit_tests args="-x -vv --splits ${{ matrix.splitCount }} --group ${{ matrix.group }} --reruns 5 --cov --cov-report=xml --cov-report=html"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.python-version == '3.10'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: backend
name: backend-coverage-group-${{ matrix.group }}
fail_ci_if_error: false
directory: ./
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
if: matrix.python-version == '3.10'
with:
name: backend-coverage-report-group-${{ matrix.group }}
path: |
coverage.xml
htmlcov/
retention-days: 30
integration-tests: