Skip to content

Commit 8ef7b01

Browse files
committed
ci: remove redis cluster setup from github actions
- Remove redis cluster configuration and setup steps - Delete multiple redis cluster nodes definitions - Remove environment variable for redis cluster nodes - Simplify the CI workflow by focusing on single redis instance
1 parent 7fd4803 commit 8ef7b01

File tree

1 file changed

+1
-67
lines changed

1 file changed

+1
-67
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -56,62 +56,9 @@ jobs:
5656
ports:
5757
- 6379:6379
5858

59-
redis-cluster-0:
60-
image: redis:alpine
61-
options: >-
62-
--entrypoint redis-server
63-
--
64-
--appendonly no
65-
--save ""
66-
--cluster-enabled yes
67-
--cluster-config-file /tmp/redis-cluster-nodes.conf
68-
ports:
69-
- 6380:6379
70-
71-
redis-cluster-1:
72-
image: redis:alpine
73-
options: >-
74-
--entrypoint redis-server
75-
--
76-
--appendonly no
77-
--save ""
78-
--cluster-enabled yes
79-
--cluster-config-file /tmp/redis-cluster-nodes.conf
80-
ports:
81-
- 6381:6379
82-
83-
redis-cluster-2:
84-
image: redis:alpine
85-
options: >-
86-
--entrypoint redis-server
87-
--
88-
--appendonly no
89-
--save ""
90-
--cluster-enabled yes
91-
--cluster-config-file /tmp/redis-cluster-nodes.conf
92-
ports:
93-
- 6382:6379
94-
9559
steps:
9660
- uses: actions/checkout@v4
9761

98-
# 1. 设置APT缓存目录权限
99-
- name: Prepare APT packages
100-
run: |
101-
echo "redis-tools" > apt-packages.txt
102-
103-
- name: Config APT cache
104-
uses: actions/cache@v4
105-
id: apt-cache
106-
with:
107-
path: /var/cache/apt
108-
key: ${{ runner.os }}-apt-${{ hashFiles('apt-packages.txt') }}
109-
110-
- name: Install APT packages
111-
run: |
112-
sudo apt-get update
113-
sudo apt-get install -y $(cat apt-packages.txt)
114-
11562
- name: Set up Python ${{ matrix.python-version }}
11663
uses: actions/setup-python@v5
11764
with:
@@ -121,24 +68,11 @@ jobs:
12168
- name: Install dependencies
12269
run: |
12370
python -m pip install --upgrade pip
124-
pip install -e . -r tests/requirements.txt pytest pytest-asyncio pytest-cov
125-
126-
- name: Wait for Redis Cluster nodes to be ready
127-
run: |
128-
timeout 30 sh -c 'until redis-cli -p 6380 ping && redis-cli -p 6381 ping && redis-cli -p 6382 ping; do sleep 1; done'
129-
130-
- name: Create Redis Cluster
131-
run: |
132-
redis-cli --cluster create localhost:6380 localhost:6381 localhost:6382 --cluster-yes
133-
134-
- name: Wait for Redis Cluster to be ready
135-
run: |
136-
timeout 30 sh -c 'until redis-cli -p 6380 --cluster info; do sleep 1; done'
71+
pip install -e . -r tests/requirements.txt
13772
13873
- name: Run tests
13974
run: |
14075
export REDIS_URL=redis://localhost:6379
141-
export REDIS_CLUSTER_NODES="localhost:6380 localhost:6381 localhost:6382"
14276
pytest -x --cov --cov-report=xml --junitxml=junit.xml
14377
14478
- name: Upload coverage to Codecov

0 commit comments

Comments
 (0)