-
-
Notifications
You must be signed in to change notification settings - Fork 150
144 lines (121 loc) · 3.6 KB
/
tests.yml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Run Tests
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
instance:
name: Testing (PHP ${{ matrix.php }}; Instance ${{ matrix.redis }})
runs-on: ubuntu-latest
timeout-minutes: 5
services:
mysql:
image: mysql:5.7
ports:
- '3306:3306'
options: >-
--health-cmd "mysqladmin -h localhost ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_DATABASE: wordpress_test
redis:
image: redis:${{ matrix.redis }}
ports:
- '6379:6379'
options: >-
--health-cmd "redis-cli cluster info"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
redis: ['3.2.12', '6.2.6', '7.0.3']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: msgpack, igbinary, redis-5.3.7
- name: Set up WordPress and WordPress Test Library
uses: sjinks/setup-wordpress-test-library@master
with:
version: latest
cache_prefix: redis-cache-${{ github.ref }}
- name: Install PHP Dependencies
uses: ramsey/composer-install@v2
- name: Install missing library
run: |
composer require --dev yoast/phpunit-polyfills
- name: Run test suite
run: ./vendor/bin/phpunit
cluster:
name: Testing (PHP ${{ matrix.php }}; Cluster ${{ matrix.redis }})
runs-on: ubuntu-latest
timeout-minutes: 5
services:
mysql:
image: mysql:5.7
ports:
- '3306:3306'
options: >-
--health-cmd "mysqladmin -h localhost ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_DATABASE: wordpress_test
redis:
image: grokzen/redis-cluster:${{ matrix.redis }}
ports:
- '6379-6384:6379-6384'
options: >-
--health-cmd "redis-cli cluster info"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
INITIAL_PORT: 6379
MASTERS: 3
SLAVES_PER_MASTER: 1
SENTINEL: false
REDIS_CLUSTER_IP: 127.0.0.1
IP: 127.0.0.1
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
redis: ['6.2.8', '7.0.7']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: msgpack, igbinary, redis-5.3.7
- name: Set up WordPress and WordPress Test Library
uses: sjinks/setup-wordpress-test-library@master
with:
version: latest
cache_prefix: redis-cache-${{ github.ref }}
- name: Install PHP Dependencies
uses: ramsey/composer-install@v2
- name: Install missing library
run: |
composer require --dev yoast/phpunit-polyfills
- name: Run test suite
run: ./vendor/bin/phpunit
env:
GH_REDIS_CLUSTER: true