-
-
Notifications
You must be signed in to change notification settings - Fork 11
172 lines (169 loc) · 5.91 KB
/
compatibility.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Compatibility
on:
create:
tags: ['*']
push:
branches: ['master']
schedule:
- cron: 0 23 * * *
jobs:
lint:
name: Lint (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/**') }}
restore-keys: |
${{ runner.os }}-pip-
- 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 setuptools wheel
pip install -r requirements/dev.txt
python setup.py build
- name: Lint with ruff
run: |
ruff coredis tests
- name: Lint with black
run: |
black --check coredis tests
- name: Check imports
run: |
isort -c --profile=black coredis tests
- name: Check types
run: |
mypy coredis
- name: Check auto generated sources
run: |
make templated-sources
if [ ! -z "$(git diff coredis)" ];
then
echo "Auto-generated source are not up to date"
git diff
exit 1
fi;
test:
name: Test (Python ${{ matrix.python-version }}, Redis ${{ matrix.redis-version }}${{ matrix.uvloop == 'True' && ', uvloop' || ''}}${{ matrix.orjson == 'True' && ', orjson' || ''}}${{ matrix.extensions == 'True' && ', compiled' || ''}}${{ matrix.label && format(', {0}', matrix.label) || '' }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.redis-version == 'next' }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
redis-version: ["6.2", "7.0", "7.2", "latest"]
test_params: ["-m '(not (keydb or dragonfly or valkey or redict))'"]
orjson: ["False"]
uvloop: ["True", "False"]
runtime_type_checks: ["True"]
extensions: ["True"]
label: [""]
include:
- python-version: "3.11"
redis-version: next
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
runtime_type_checks: "True"
label: ""
- python-version: "3.11"
redis-version: latest
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
extensions: "False"
runtime_type_checks: "True"
label: ""
- python-version: "3.11"
redis-version: latest
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
runtime_type_checks: "True"
orjson: "True"
label: ""
- python-version: "3.11"
redis-version: 7.0
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
runtime_type_checks: "False"
label: ""
- python-version: "3.11"
redis-version: 7.0
test_params: "-m keydb"
runtime_type_checks: "False"
label: "KeyDB"
- python-version: "3.11"
redis-version: 7.0
test_params: "-m dragonfly"
label: "Dragonfly"
- python-version: "3.11"
redis-version: 7.0
test_params: "-m valkey"
label: "Valkey"
- python-version: "3.11"
redis-version: 7.0
test_params: "-m redict"
label: "Redict"
- python-version: "pypy-3.8"
redis-version: 7.0
test_params: "-m '(not (keydb or dragonfly or valkey or redict))' tests/commands tests/test_tracking_cache.py"
runtime_type_checks: "False"
extensions: "False"
uvloop: "False"
label: ""
- python-version: "pypy-3.9"
redis-version: 7.0
test_params: "-m '(not (keydb or dragonfly or valkey or redict))' tests/commands tests/test_tracking_cache.py"
runtime_type_checks: "False"
extensions: "False"
uvloop: "False"
label: ""
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements/**') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- 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 setuptools wheel
pip install -r requirements/ci.txt
python setup.py build
- name: Compile extensions
if: ${{ matrix.extensions == 'True' }}
run: python setup.py build_ext --inplace --use-mypyc
- name: Install uvloop
if: ${{ matrix.uvloop == 'True' }}
run:
pip install uvloop
- name: Install orjson
if: ${{ matrix.orjson == 'True' }}
run:
pip install orjson
- name: Tests with coverage
env:
COREDIS_UVLOOP: ${{ matrix.uvloop }}
HOST_OS: linux
CI: "True"
COREDIS_REDIS_VERSION: ${{matrix.redis-version}}
COREDIS_RUNTIME_CHECKS: ${{matrix.runtime_type_checks}}
PYTEST_SENTRY_DSN: ${{ matrix.extensions != 'True' && secrets.SENTRY_DSN || ''}}
run: |
echo "Runtime checks: $COREDIS_RUNTIME_CHECKS"
echo "UVLoop: $COREDIS_UVLOOP"
echo "CI: $CI"
pytest -q --reverse --reruns 2 --cov=coredis --cov-report=xml ${{ matrix.test_params }}
- name: Upload coverage to Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}