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
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ jobs:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write # Required for Codecov OIDC
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -163,11 +166,35 @@ jobs:
run: |
uv sync --group dev

- name: Run critical tests
- name: Run critical tests with coverage
env:
REDIS_URL: redis://localhost:6379
run: |
make test-critical
uv run pytest tests/critical/ -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 }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
files: ./junit.xml
report_type: test_results
use_oidc: true
flags: python-${{ matrix.python-version }}
fail_ci_if_error: false

# Markdown documentation tests
test-docs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ htmlcov/
nosetests.xml
coverage-rust-html/
coverage.xml
junit.xml
*.coveragerc

# IDEs
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Production-ready Redis caching for Python with intelligent reliability features

[![PyPI Version][pypi-badge]][pypi-url]
[![Python Versions][python-badge]][pypi-url]
[![codecov][codecov-badge]][codecov-url]
[![License: MIT][license-badge]][license-url]

</div>
Expand Down Expand Up @@ -382,3 +383,5 @@ MIT License - see [LICENSE][license-file-url] for details.
[license-file-url]: LICENSE
[github-url]: https://github.com/cachekit-io/cachekit-py
[issues-url]: https://github.com/cachekit-io/cachekit-py/issues
[codecov-badge]: https://codecov.io/github/cachekit-io/cachekit-py/graph/badge.svg
[codecov-url]: https://codecov.io/github/cachekit-io/cachekit-py
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,32 @@ doctest_optionflags = [
"ELLIPSIS",
]

# Coverage configuration
[tool.coverage.run]
source = ["src/cachekit"]
branch = true
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/.venv/*",
]

[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
"@overload",
"class .*\\bProtocol\\b.*:",
]

[dependency-groups]
dev = [
# Testing
Expand Down
Loading