Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ jobs:
run: |
uv sync --group dev

- name: Run critical tests with coverage
- name: Run critical tests (PRs)
if: github.event_name == 'pull_request'
env:
REDIS_URL: redis://localhost:6379
run: |
Expand All @@ -177,14 +178,26 @@ jobs:
--junitxml=junit.xml \
-o junit_family=legacy

- name: Run full test suite (main)
if: github.event_name == 'push'
env:
REDIS_URL: redis://localhost:6379
run: |
uv run pytest tests/ -m "not slow" \
--cov=src/cachekit \
--cov-report=xml \
--cov-report=term \
--junitxml=junit.xml \
-o junit_family=legacy

- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
use_oidc: true
fail_ci_if_error: false
flags: python-${{ matrix.python-version }}
flags: ${{ github.event_name == 'push' && 'full' || 'critical' }}-python-${{ matrix.python-version }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
Expand All @@ -193,7 +206,7 @@ jobs:
files: ./junit.xml
report_type: test_results
use_oidc: true
flags: python-${{ matrix.python-version }}
flags: ${{ github.event_name == 'push' && 'full' || 'critical' }}-python-${{ matrix.python-version }}
fail_ci_if_error: false

# Markdown documentation tests
Expand Down
39 changes: 39 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Codecov Configuration
# https://docs.codecov.com/docs/codecovyml-reference

coverage:
status:
project:
default:
target: auto
threshold: 2% # Allow 2% coverage drop without failing
patch:
default:
target: 80% # New code should have 80% coverage

# Flag configuration for PR vs main coverage strategy
flag_management:
default_rules:
carryforward: true # Carry forward coverage from previous uploads
statuses:
- type: project
- type: patch

individual_flags:
# Full test suite (main branch only)
- name: full-python-3.12
carryforward: true
paths:
- src/cachekit/

# Critical tests (PRs) - carryforward from full coverage
- name: critical-python-3.12
carryforward: true
carryforward_mode: labels
paths:
- src/cachekit/

comment:
layout: "header, diff, flags, components"
behavior: default
require_changes: true # Only comment if coverage changed
Loading