Skip to content

Commit 12c2b11

Browse files
committed
feat: add functionality from taskiq-redis
1 parent 5c89fc7 commit 12c2b11

21 files changed

Lines changed: 3987 additions & 280 deletions

.github/workflows/test.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
name: Testing package
1+
name: Testing taskiq-valkey
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
49

510
jobs:
611
lint:
712
strategy:
813
matrix:
914
cmd:
1015
- black
11-
- mypy
1216
- ruff
17+
- mypy
1318
runs-on: ubuntu-latest
1419
steps:
1520
- uses: actions/checkout@v4
@@ -18,40 +23,40 @@ jobs:
1823
- name: Set up Python
1924
uses: actions/setup-python@v4
2025
with:
21-
python-version: "3.9"
26+
python-version: "3.11"
2227
cache: "poetry"
2328
- name: Install deps
2429
run: poetry install
2530
- name: Run lint check
2631
run: poetry run pre-commit run -a ${{ matrix.cmd }}
2732
pytest:
28-
permissions:
29-
checks: write
30-
pull-requests: write
31-
contents: write
3233
strategy:
3334
matrix:
3435
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
35-
os: [ubuntu-latest, windows-latest]
36-
runs-on: "${{ matrix.os }}"
36+
runs-on: "ubuntu-latest"
3737
steps:
3838
- uses: actions/checkout@v4
39-
- name: Install poetry
40-
run: pipx install poetry
39+
- name: Set up Valkey instance and Valkey cluster
40+
run: docker compose up -d
4141
- name: Set up Python
42-
uses: actions/setup-python@v4
42+
uses: actions/setup-python@v2
4343
with:
4444
python-version: "${{ matrix.py_version }}"
45-
cache: "poetry"
45+
- name: Update pip
46+
run: python -m pip install -U pip
47+
- name: Install poetry
48+
run: python -m pip install poetry
4649
- name: Install deps
4750
run: poetry install
51+
env:
52+
POETRY_VIRTUALENVS_CREATE: false
4853
- name: Run pytest check
4954
run: poetry run pytest -vv -n auto --cov="taskiq_valkey" .
5055
- name: Generate report
5156
run: poetry run coverage xml
5257
- name: Upload coverage reports to Codecov with GitHub Action
5358
uses: codecov/codecov-action@v3
54-
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.11'
59+
if: matrix.py_version == '3.9'
5560
with:
5661
token: ${{ secrets.CODECOV_TOKEN }}
5762
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.4.0
5+
rev: v5.0.0
66
hooks:
77
- id: check-ast
88
- id: trailing-whitespace

docker-compose.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
services:
2+
valkey:
3+
image: bitnami/valkey:7.2.7
4+
environment:
5+
ALLOW_EMPTY_PASSWORD: "yes"
6+
healthcheck:
7+
test: ["CMD", "valkey-cli", "ping"]
8+
interval: 5s
9+
timeout: 5s
10+
retries: 3
11+
start_period: 10s
12+
ports:
13+
- 7000:6379
14+
valkey-node-0: &valkey-node
15+
image: docker.io/bitnami/valkey-cluster:7.2.7
16+
environment:
17+
ALLOW_EMPTY_PASSWORD: "yes"
18+
VALKEY_NODES: "valkey-node-0 valkey-node-1 valkey-node-2 valkey-node-3 valkey-node-4 valkey-node-5"
19+
healthcheck:
20+
test: ["CMD", "valkey-cli", "ping"]
21+
interval: 5s
22+
timeout: 5s
23+
retries: 3
24+
start_period: 10s
25+
26+
valkey-node-1:
27+
<<: *valkey-node
28+
29+
valkey-node-2:
30+
<<: *valkey-node
31+
32+
valkey-node-3:
33+
<<: *valkey-node
34+
35+
valkey-node-4:
36+
<<: *valkey-node
37+
38+
valkey-node-5:
39+
image: docker.io/bitnami/valkey-cluster:7.2.7
40+
depends_on:
41+
- valkey-node-0
42+
- valkey-node-1
43+
- valkey-node-2
44+
- valkey-node-3
45+
- valkey-node-4
46+
environment:
47+
ALLOW_EMPTY_PASSWORD: "yes"
48+
VALKEY_NODES: "valkey-node-0 valkey-node-1 valkey-node-2 valkey-node-3 valkey-node-4 valkey-node-5"
49+
VALKEY_CLUSTER_REPLICAS: 1
50+
VALKEY_CLUSTER_CREATOR: "yes"
51+
healthcheck:
52+
test: ["CMD", "valkey-cli", "ping"]
53+
interval: 5s
54+
timeout: 5s
55+
retries: 3
56+
start_period: 10s
57+
ports:
58+
- 7001:6379
59+
60+
valkey-master:
61+
image: bitnami/valkey:7.2.7
62+
environment:
63+
ALLOW_EMPTY_PASSWORD: "yes"
64+
healthcheck:
65+
test: ["CMD", "valkey-cli", "ping"]
66+
interval: 5s
67+
timeout: 5s
68+
retries: 3
69+
start_period: 10s
70+
71+
valkey-sentinel:
72+
image: bitnami/valkey-sentinel:7.2.7
73+
depends_on:
74+
- valkey-master
75+
environment:
76+
ALLOW_EMPTY_PASSWORD: "yes"
77+
VALKEY_MASTER_HOST: "valkey-master"
78+
healthcheck:
79+
test: ["CMD", "valkey-cli", "-p", "26379", "ping"]
80+
interval: 5s
81+
timeout: 5s
82+
retries: 3
83+
start_period: 10s
84+
ports:
85+
- 7002:26379

0 commit comments

Comments
 (0)