Skip to content

chore: Remove examples from CI and tooling paths #51

chore: Remove examples from CI and tooling paths

chore: Remove examples from CI and tooling paths #51

Workflow file for this run

name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
minimal-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install core only (no redis / fastapi)
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Smoke test embedded memory backend
run: |
python -c "
import asyncio
from yokedcache import YokedCache
from yokedcache.config import CacheConfig
async def main():
c = YokedCache(CacheConfig())
await c.connect()
await c.set('k', {'a': 1})
assert await c.get('k') == {'a': 1}
await c.disconnect()
asyncio.run(main())
"
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
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 dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Check formatting with black
run: |
black --check src tests
- name: Check import sorting with isort
run: |
isort --check-only --diff src tests
- name: Type check with mypy
run: |
mypy src --ignore-missing-imports --disable-error-code=unused-ignore
- name: Test with pytest
run: |
pytest --cov=yokedcache --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
integration-test:
runs-on: ubuntu-latest
needs: test
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,sqlalchemy,fuzzy]"
- name: Redis integration smoke
run: |
python -c "
import asyncio
import os
from yokedcache import YokedCache
from yokedcache.config import CacheConfig
async def main():
url = os.environ.get('YOKEDCACHE_REDIS_URL', 'redis://127.0.0.1:6379/0')
c = YokedCache(CacheConfig(redis_url=url))
await c.connect()
await c.set('ci_smoke', {'ok': True}, ttl=60)
v = await c.get('ci_smoke')
assert v == {'ok': True}, v
await c.delete('ci_smoke')
await c.disconnect()
asyncio.run(main())
"
env:
YOKEDCACHE_REDIS_URL: redis://127.0.0.1:6379/0
- name: Test CLI
run: |
python -m yokedcache ping
python -m yokedcache stats --format json