Skip to content

Commit 2d129df

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

File tree

2 files changed

+143
-107
lines changed

2 files changed

+143
-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: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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 Broadcasting tests
51+
run: vendor/bin/phpunit tests/Integration/Broadcasting
52+
env:
53+
REDIS_CLIENT: ${{ matrix.client }}
54+
55+
- name: Execute Cache tests
56+
run: vendor/bin/phpunit tests/Integration/Cache
57+
env:
58+
REDIS_CACHE_CONNECTION: cache
59+
REDIS_CACHE_LOCK_CONNECTION: cache
60+
REDIS_CLIENT: ${{ matrix.client }}
61+
62+
- name: Execute Queue tests
63+
run: vendor/bin/phpunit tests/Integration/Queue
64+
env:
65+
REDIS_CLIENT: ${{ matrix.client }}
66+
QUEUE_CONNECTION: redis
67+
68+
redis-cluster:
69+
runs-on: ubuntu-24.04
70+
71+
strategy:
72+
fail-fast: true
73+
matrix:
74+
client: ['phpredis', 'predis']
75+
76+
name: Redis Cluster (${{ matrix.client}}) Driver
77+
78+
steps:
79+
- name: Checkout code
80+
uses: actions/checkout@v4
81+
82+
- name: Setup PHP
83+
uses: shivammathur/setup-php@v2
84+
with:
85+
php-version: 8.2
86+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
87+
tools: composer:v2
88+
coverage: none
89+
90+
- name: Set Framework version
91+
run: composer config version "12.x-dev"
92+
93+
- name: Install dependencies
94+
uses: nick-fields/retry@v3
95+
with:
96+
timeout_minutes: 5
97+
max_attempts: 5
98+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
99+
100+
- name: Create Redis Cluster
101+
run: |
102+
sudo apt update
103+
sudo apt-get install -y --fix-missing redis-server
104+
sudo service redis-server stop
105+
redis-server --daemonize yes --port 7000 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7000.conf
106+
redis-server --daemonize yes --port 7001 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7001.conf
107+
redis-server --daemonize yes --port 7002 --appendonly yes --cluster-enabled yes --cluster-config-file nodes-7002.conf
108+
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 --cluster-replicas 0 --cluster-yes
109+
110+
- name: Check Redis Cluster is ready
111+
uses: nick-fields/retry@v3
112+
with:
113+
timeout_seconds: 5
114+
max_attempts: 5
115+
retry_wait_seconds: 5
116+
retry_on: error
117+
command: |
118+
redis-cli -c -h 127.0.0.1 -p 7000 cluster info | grep "cluster_state:ok"
119+
redis-cli -c -h 127.0.0.1 -p 7001 cluster info | grep "cluster_state:ok"
120+
redis-cli -c -h 127.0.0.1 -p 7002 cluster info | grep "cluster_state:ok"
121+
122+
- name: Execute Broadcasting tests
123+
run: vendor/bin/phpunit tests/Integration/Broadcasting
124+
env:
125+
REDIS_CLIENT: ${{ matrix.client }}
126+
REDIS_CLUSTER_HOSTS_AND_PORTS: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002
127+
128+
- name: Execute Cache tests
129+
run: vendor/bin/phpunit tests/Integration/Cache
130+
env:
131+
REDIS_CACHE_CONNECTION: default
132+
REDIS_CACHE_LOCK_CONNECTION: default
133+
REDIS_CLIENT: ${{ matrix.client }}
134+
REDIS_CLUSTER_HOSTS_AND_PORTS: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002
135+
136+
- name: Execute Queue Tests
137+
run: vendor/bin/phpunit tests/Integration/Queue
138+
env:
139+
REDIS_CLIENT: ${{ matrix.client }}
140+
REDIS_CLUSTER_HOSTS_AND_PORTS: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002
141+
REDIS_QUEUE: '{default}'
142+
QUEUE_CONNECTION: redis
143+

0 commit comments

Comments
 (0)