From ee2964e151e00c978c1f3f47c14b065c858c2042 Mon Sep 17 00:00:00 2001 From: Zihao Xu Date: Mon, 19 Jan 2026 04:47:26 -0800 Subject: [PATCH] ci: add coverage reporting, 60% threshold, and Codecov integration (#53) - Add pytest-cov to CI dependencies - Generate coverage report (xml + terminal) - Set minimum coverage threshold to 60% (current: 63%, target: 90%) - Upload coverage to Codecov - Add 10 minute timeout Closes #46, closes #47, closes #48 --- .github/workflows/test.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 526c82e..3c461ed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,7 @@ on: jobs: test: runs-on: ubuntu-latest + timeout-minutes: 10 steps: - uses: actions/checkout@v4 @@ -27,7 +28,14 @@ jobs: - name: Install dependencies run: | uv pip install --system -r requirements.txt - uv pip install --system pytest + uv pip install --system pytest pytest-cov - - name: Run tests - run: pytest -v + - name: Run tests with coverage + run: pytest -v --cov=src --cov-report=xml --cov-report=term --cov-fail-under=60 + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./coverage.xml + fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} # Optional for public repos, but recommended