Skip to content

feat: add CacheManager.add() for atomic store-if-absent #125

feat: add CacheManager.add() for atomic store-if-absent

feat: add CacheManager.add() for atomic store-if-absent #125

Workflow file for this run

name: Coverage Badge
on:
push:
branches: [ "master" ]
paths:
- '**.py'
- 'pyproject.toml'
- '.github/workflows/coverage.yml'
pull_request:
branches: [ "master" ]
paths:
- '**.py'
- 'pyproject.toml'
- '.github/workflows/coverage.yml'
permissions:
contents: write
jobs:
coverage:
runs-on: ubuntu-latest
services:
memcached:
image: memcached:1.6-alpine
ports:
- 11211:11211
redis:
image: redis:alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v10.1.0
- name: Sync dependencies
run: uv sync
- name: Generate coverage report
run: |
uv run coverage run -m pytest
uv run coverage report
uv run coverage xml
uv tool run --from genbadge[coverage] genbadge coverage -i coverage.xml -o coverage.svg
env:
# The suites that talk to a real server are opt-in: they wipe what they
# connect to, so they skip unless a port is named. These are the service
# containers above, which exist only for this job.
CACHEX_TEST_REDIS_PORT: 6379
CACHEX_TEST_MEMCACHED_PORT: 11211
# ...and here the services are this workflow's own responsibility, so a
# skipped suite is a broken job, not a safe default. Without this a
# wrong port silently drops those tests and the run is still green:
# coverage stays near 97%, well over the 90% gate.
CACHEX_REQUIRE_LIVE_SERVERS: 1
- name: Upload coverage badge
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: coverage-badge
folder: .
target-folder: .
clean: false