From 5bbb0e35bf0c6650f4cc7f66d8fd6d0a0e8a2051 Mon Sep 17 00:00:00 2001 From: mgama-deepgram Date: Thu, 25 Jun 2026 17:11:20 -0700 Subject: [PATCH 1/2] Adding code coverage processes on CI.yml workflow --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2128e6b0..c3e76661 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [push] +on: [push, pull_request] jobs: compile: @@ -27,6 +27,9 @@ jobs: run: poetry run mypy src/ test: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] @@ -46,6 +49,8 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Install dependencies run: poetry install + - name: Install coverage tool + run: poetry run pip install pytest-cov - name: Verify Docker is available run: | @@ -53,7 +58,27 @@ jobs: docker compose version - name: Test - run: poetry run pytest -rP . + run: poetry run pytest -rP --cov=deepgram --cov-report=xml --cov-report=term . + - name: Generate code coverage summary + if: matrix.python-version == '3.13' + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: coverage.xml + badge: true + format: markdown + hide_complexity: true + indicators: true + output: both + - name: Add coverage PR comment + if: matrix.python-version == '3.13' && github.event_name == 'pull_request' + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: code-coverage + recreate: true + path: code-coverage-results.md + - name: Write coverage to job summary + if: matrix.python-version == '3.13' + run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY publish: needs: [compile, test] From 59e86a158ee48d5638b83a7ab8eb60c81c6b1f62 Mon Sep 17 00:00:00 2001 From: mgama-deepgram Date: Fri, 26 Jun 2026 15:34:25 -0700 Subject: [PATCH 2/2] Improving code coverage config to include branch coverage --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3e76661..42c43eeb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: docker compose version - name: Test - run: poetry run pytest -rP --cov=deepgram --cov-report=xml --cov-report=term . + run: poetry run pytest -rP --cov=deepgram --cov-branch --cov-report=xml --cov-report=term-missing . - name: Generate code coverage summary if: matrix.python-version == '3.13' uses: irongut/CodeCoverageSummary@v1.3.0 @@ -66,9 +66,11 @@ jobs: filename: coverage.xml badge: true format: markdown - hide_complexity: true + hide_branch_rate: false + hide_complexity: false indicators: true output: both + thresholds: "60 80" - name: Add coverage PR comment if: matrix.python-version == '3.13' && github.event_name == 'pull_request' uses: marocchino/sticky-pull-request-comment@v2