Skip to content

Commit c62d43e

Browse files
committed
[12.x] Separate workflow for Redis integration tests
1 parent cafe1ac commit c62d43e

File tree

2 files changed

+132
-107
lines changed

2 files changed

+132
-107
lines changed

.github/workflows/queues.yml

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -82,113 +82,6 @@ jobs:
8282
DB_CONNECTION: sqlite
8383
QUEUE_CONNECTION: database
8484

85-
redis:
86-
runs-on: ubuntu-24.04
87-
88-
services:
89-
redis:
90-
image: redis:7.0
91-
ports:
92-
- 6379:6379
93-
options: --entrypoint redis-server
94-
95-
strategy:
96-
fail-fast: true
97-
matrix:
98-
client: ['phpredis', 'predis']
99-
100-
name: Redis (${{ matrix.client}}) Driver
101-
102-
steps:
103-
- name: Checkout code
104-
uses: actions/checkout@v4
105-
106-
- name: Setup PHP
107-
uses: shivammathur/setup-php@v2
108-
with:
109-
php-version: 8.2
110-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
111-
tools: composer:v2
112-
coverage: none
113-
114-
- name: Set Framework version
115-
run: composer config version "12.x-dev"
116-
117-
- name: Install dependencies
118-
uses: nick-fields/retry@v3
119-
with:
120-
timeout_minutes: 5
121-
max_attempts: 5
122-
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
123-
124-
- name: Execute tests
125-
run: vendor/bin/phpunit tests/Integration/Queue
126-
env:
127-
REDIS_CLIENT: ${{ matrix.client }}
128-
QUEUE_CONNECTION: redis
129-
130-
redis-cluster:
131-
runs-on: ubuntu-24.04
132-
133-
strategy:
134-
fail-fast: true
135-
matrix:
136-
client: ['phpredis', 'predis']
137-
138-
name: Redis Cluster (${{ matrix.client}}) Driver
139-
140-
steps:
141-
- name: Checkout code
142-
uses: actions/checkout@v4
143-
144-
- name: Setup PHP
145-
uses: shivammathur/setup-php@v2
146-
with:
147-
php-version: 8.2
148-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
149-
tools: composer:v2
150-
coverage: none
151-
152-
- name: Set Framework version
153-
run: composer config version "12.x-dev"
154-
155-
- name: Install dependencies
156-
uses: nick-fields/retry@v3
157-
with:
158-
timeout_minutes: 5
159-
max_attempts: 5
160-
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
161-
162-
- name: Create Redis Cluster
163-
run: |
164-
sudo apt update
165-
sudo apt-get install -y --fix-missing redis-server
166-
sudo service redis-server stop
167-
redis-server --daemonize yes --port 7000 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7000.conf
168-
redis-server --daemonize yes --port 7001 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7001.conf
169-
redis-server --daemonize yes --port 7002 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7002.conf
170-
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 --cluster-replicas 0 --cluster-yes
171-
172-
- name: Check Redis Cluster is ready
173-
uses: nick-fields/retry@v3
174-
with:
175-
timeout_seconds: 5
176-
max_attempts: 5
177-
retry_wait_seconds: 5
178-
retry_on: error
179-
command: |
180-
redis-cli -c -h 127.0.0.1 -p 7000 cluster info | grep "cluster_state:ok"
181-
redis-cli -c -h 127.0.0.1 -p 7001 cluster info | grep "cluster_state:ok"
182-
redis-cli -c -h 127.0.0.1 -p 7002 cluster info | grep "cluster_state:ok"
183-
184-
- name: Execute tests
185-
run: vendor/bin/phpunit tests/Integration/Queue
186-
env:
187-
REDIS_CLIENT: ${{ matrix.client }}
188-
REDIS_CLUSTER_HOSTS_AND_PORTS: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002
189-
REDIS_QUEUE: '{default}'
190-
QUEUE_CONNECTION: redis
191-
19285
beanstalkd:
19386
runs-on: ubuntu-24.04
19487

.github/workflows/redis.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Redis and Redis Cluster
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
9+
10+
jobs:
11+
redis:
12+
runs-on: ubuntu-24.04
13+
14+
services:
15+
redis:
16+
image: redis:7.0
17+
ports:
18+
- 6379:6379
19+
options: --entrypoint redis-server
20+
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
client: ['phpredis', 'predis']
25+
26+
name: Redis (${{ matrix.client}}) Driver
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: 8.2
36+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
37+
tools: composer:v2
38+
coverage: none
39+
40+
- name: Set Framework version
41+
run: composer config version "12.x-dev"
42+
43+
- name: Install dependencies
44+
uses: nick-fields/retry@v3
45+
with:
46+
timeout_minutes: 5
47+
max_attempts: 5
48+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
49+
50+
- name: Execute Cache tests
51+
run: vendor/bin/phpunit tests/Integration/Cache
52+
env:
53+
REDIS_CACHE_CONNECTION: cache
54+
REDIS_CACHE_LOCK_CONNECTION: cache
55+
REDIS_CLIENT: ${{ matrix.client }}
56+
57+
- name: Execute Queue tests
58+
run: vendor/bin/phpunit tests/Integration/Queue
59+
env:
60+
REDIS_CLIENT: ${{ matrix.client }}
61+
QUEUE_CONNECTION: redis
62+
63+
redis-cluster:
64+
runs-on: ubuntu-24.04
65+
66+
strategy:
67+
fail-fast: true
68+
matrix:
69+
client: ['phpredis', 'predis']
70+
71+
name: Redis Cluster (${{ matrix.client}}) Driver
72+
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
76+
77+
- name: Setup PHP
78+
uses: shivammathur/setup-php@v2
79+
with:
80+
php-version: 8.2
81+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
82+
tools: composer:v2
83+
coverage: none
84+
85+
- name: Set Framework version
86+
run: composer config version "12.x-dev"
87+
88+
- name: Install dependencies
89+
uses: nick-fields/retry@v3
90+
with:
91+
timeout_minutes: 5
92+
max_attempts: 5
93+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
94+
95+
- name: Create Redis Cluster
96+
run: |
97+
sudo apt update
98+
sudo apt-get install -y --fix-missing redis-server
99+
sudo service redis-server stop
100+
redis-server --daemonize yes --port 7000 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7000.conf
101+
redis-server --daemonize yes --port 7001 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7001.conf
102+
redis-server --daemonize yes --port 7002 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7002.conf
103+
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 --cluster-replicas 0 --cluster-yes
104+
105+
- name: Check Redis Cluster is ready
106+
uses: nick-fields/retry@v3
107+
with:
108+
timeout_seconds: 5
109+
max_attempts: 5
110+
retry_wait_seconds: 5
111+
retry_on: error
112+
command: |
113+
redis-cli -c -h 127.0.0.1 -p 7000 cluster info | grep "cluster_state:ok"
114+
redis-cli -c -h 127.0.0.1 -p 7001 cluster info | grep "cluster_state:ok"
115+
redis-cli -c -h 127.0.0.1 -p 7002 cluster info | grep "cluster_state:ok"
116+
117+
- name: Execute Cache tests
118+
run: vendor/bin/phpunit tests/Integration/Cache
119+
env:
120+
REDIS_CACHE_CONNECTION: default
121+
REDIS_CACHE_LOCK_CONNECTION: default
122+
REDIS_CLIENT: ${{ matrix.client }}
123+
REDIS_CLUSTER_HOSTS_AND_PORTS: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002
124+
125+
- name: Execute Queue Tests
126+
run: vendor/bin/phpunit tests/Integration/Queue
127+
env:
128+
REDIS_CLIENT: ${{ matrix.client }}
129+
REDIS_CLUSTER_HOSTS_AND_PORTS: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002
130+
REDIS_QUEUE: '{default}'
131+
QUEUE_CONNECTION: redis
132+

0 commit comments

Comments
 (0)