-
Notifications
You must be signed in to change notification settings - Fork 9
76 lines (65 loc) · 2.1 KB
/
ci.yml
File metadata and controls
76 lines (65 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Docket CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
jobs:
test:
name: Test Python ${{ matrix.python-version }}, ${{ matrix.backend.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
backend:
- name: "Redis 6.2, redis-py <5"
redis-version: "6.2"
redis-py-version: ">=4.6,<5"
- name: "Redis 7.4, redis-py >=5"
redis-version: "7.4"
redis-py-version: ">=5"
- name: "Valkey 8.0, redis-py >=5"
redis-version: "valkey-8.0"
redis-py-version: ">=5"
- name: "Memory (in-memory backend)"
redis-version: "memory"
redis-py-version: ">=5"
steps:
- uses: actions/checkout@v4
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: uv sync --dev --upgrade-package 'redis${{ matrix.backend.redis-py-version }}'
- name: Run tests
env:
REDIS_VERSION: ${{ matrix.backend.redis-version }}
run: uv run pytest --cov-branch --cov-fail-under=100 --cov-report=xml --cov-report=term-missing:skip-covered
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python-${{ matrix.python-version }}
pre-commit:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: |
uv sync --dev
uv pip install pip
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files