Skip to content

feat: clean functional API, pluggable serializers #39

feat: clean functional API, pluggable serializers

feat: clean functional API, pluggable serializers #39

Workflow file for this run

name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
- name: Create virtual environment and install dependencies
run: |
uv venv
uv pip install -e ".[dev,redis]"
- name: Check code formatting with ruff
run: uv run ruff format --check src/ tests/
- name: Run unit tests
run: uv run pytest tests/test_correctness.py -v --tb=short
- name: Setup Docker (for testcontainers)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: |
# Docker is already installed on ubuntu-latest runners
docker --version
- name: Run integration tests (Redis with testcontainers)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: uv run pytest tests/test_integration_redis.py -v --tb=short
- name: Run benchmarks
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: uv run python tests/benchmark.py
- name: Generate coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: uv run pytest tests/test_correctness.py tests/test_integration_redis.py --cov=src/advanced_caching --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false