-
-
Notifications
You must be signed in to change notification settings - Fork 72
116 lines (113 loc) · 3.3 KB
/
test.yml
File metadata and controls
116 lines (113 loc) · 3.3 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
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
---
name: Unit tests
on:
push:
branches:
- master
# pull_request:
# branches:
# - master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ruff:
uses: ./.github/workflows/lint.yml
basic_tests:
needs: ["ruff"]
name: Tests without server
uses: ./.github/workflows/test-no-matrix.yml
test:
needs: ["ruff", "basic_tests"]
runs-on: ubuntu-latest
strategy:
max-parallel: 8
fail-fast: false
matrix:
redis-image:
- "redis:8.4.0"
- "valkey/valkey:9.0.0"
- "redis:7.4.2"
- "valkey/valkey:8.1.3"
- "redis:6.2.17"
python-version: ["3.9", "3.12", "3.13", "3.14"]
redis-py: ["4.6.0", "5.3.1", "6.4.0", "7.2.0"]
install-extras: [false]
coverage: [false]
exclude:
- python-version: "3.9"
redis-py: "7.2.0"
- python-version: "3.13"
redis-image: "redis:8.4.0"
redis-py: "7.2.0"
install-extras: false
coverage: false
include:
- python-version: "3.13"
redis-image: "redis/redis-stack-server:6.2.6-v20"
redis-py: "7.2.0"
install-extras: true
- python-version: "3.13"
redis-image: "redis/redis-stack-server:7.4.0-v3"
redis-py: "7.2.0"
install-extras: true
- python-version: "3.13"
redis-image: "redis:8.4.0"
redis-py: "7.2.0"
install-extras: true
coverage: true
permissions:
pull-requests: write
services:
keydb:
image: ${{ matrix.redis-image }}
ports:
- 6390:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
name: >
tests
${{ matrix.redis-image }},
py${{ matrix.python-version }},redis-py:${{ matrix.redis-py }},
cov:${{ matrix.coverage }},extra:${{matrix.install-extras}}
outputs:
version: ${{ steps.getVersion.outputs.VERSION }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v6
with:
cache-dependency-path: uv.lock
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
run: |
uv sync --extra lua --extra valkey
if [ ${{ matrix.install-extras }} == true ]; then
uv sync --all-extras
fi
uv pip install redis==${{ matrix.redis-py }}
- name: Get version
id: getVersion
shell: bash
run: |
VERSION=$(uv version --short)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Test without coverage
timeout-minutes: 4
if: ${{ !matrix.coverage }}
run: |
uv run pytest -v -m "not slow and not tcp_server"
- name: Test with coverage
if: ${{ matrix.coverage }}
uses: ./.github/actions/test-coverage
with:
github-secret: ${{ secrets.GITHUB_TOKEN }}
gist-secret: ${{ secrets.GIST_SECRET }}