Repository navigation
211 lines (180 loc) · 6.36 KB
/
Copy pathtests.yml
File metadata and controls
211 lines (180 loc) · 6.36 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
tests-ch21:
name: PHP ${{ matrix.php }} / ClickHouse 21.9
runs-on: ubuntu-latest
# PHP 8.6 is a pre-release (8.6.0-dev) — its failures must not block merges
continue-on-error: ${{ matrix.php == '8.6' }}
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
services:
clickhouse:
image: clickhouse/clickhouse-server:21.9
ports:
- 8123:8123
# The clickhouse-server image ships wget but NOT curl, so the health check
# must use wget — otherwise the service container never becomes healthy and
# GitHub Actions reports "container failed to start".
options: >-
--health-cmd "wget --no-verbose --tries=1 --spider http://127.0.0.1:8123/ping || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json
coverage: none
- name: Install dependencies
run: composer install --no-progress --prefer-dist
- name: Run tests (ClickHouse 21.9)
run: ./vendor/bin/phpunit -c phpunit-ch21.xml
env:
CLICKHOUSE_HOST: 127.0.0.1
CLICKHOUSE_PORT: 8123
tests-ch26:
name: PHP ${{ matrix.php }} / ClickHouse 26.3
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.php == '8.6' }}
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
services:
clickhouse:
image: clickhouse/clickhouse-server:26.3.3.20
ports:
- 8124:8123
env:
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
CLICKHOUSE_PASSWORD: ""
# See the CH21 service above: the image has wget but not curl.
options: >-
--health-cmd "wget --no-verbose --tries=1 --spider http://127.0.0.1:8123/ping || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json
coverage: none
- name: Install dependencies
run: composer install --no-progress --prefer-dist
- name: Copy ClickHouse config (deprecated syntax + embedded Keeper for ON CLUSTER)
run: |
CONTAINER_ID=$(docker ps -q --filter "ancestor=clickhouse/clickhouse-server:26.3.3.20")
docker cp tests/clickhouse-latest-config/allow_deprecated.xml "$CONTAINER_ID":/etc/clickhouse-server/users.d/allow_deprecated.xml
docker cp tests/clickhouse-latest-config/keeper.xml "$CONTAINER_ID":/etc/clickhouse-server/config.d/keeper.xml
docker restart "$CONTAINER_ID"
for i in $(seq 1 30); do
if curl -fs http://127.0.0.1:8124/ping > /dev/null; then
echo "ClickHouse ready"
exit 0
fi
sleep 2
done
echo "ClickHouse failed to become ready"
docker logs "$CONTAINER_ID"
exit 1
- name: Run tests (ClickHouse 26.3)
run: ./vendor/bin/phpunit -c phpunit-ch26.xml
env:
CLICKHOUSE_HOST: 127.0.0.1
CLICKHOUSE_PORT: 8124
tests-ch269:
name: PHP ${{ matrix.php }} / ClickHouse 26.9
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.php == '8.6' }}
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
services:
clickhouse:
image: clickhouse/clickhouse-server:26.9.1.1629
ports:
- 8125:8123
env:
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
CLICKHOUSE_PASSWORD: ""
# See the CH21 service above: the image has wget but not curl.
options: >-
--health-cmd "wget --no-verbose --tries=1 --spider http://127.0.0.1:8123/ping || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json
coverage: none
- name: Install dependencies
run: composer install --no-progress --prefer-dist
- name: Copy ClickHouse config (deprecated syntax + embedded Keeper for ON CLUSTER)
run: |
CONTAINER_ID=$(docker ps -q --filter "ancestor=clickhouse/clickhouse-server:26.9.1.1629")
docker cp tests/clickhouse-latest-config/allow_deprecated.xml "$CONTAINER_ID":/etc/clickhouse-server/users.d/allow_deprecated.xml
docker cp tests/clickhouse-latest-config/keeper.xml "$CONTAINER_ID":/etc/clickhouse-server/config.d/keeper.xml
docker restart "$CONTAINER_ID"
for i in $(seq 1 30); do
if curl -fs http://127.0.0.1:8125/ping > /dev/null; then
echo "ClickHouse ready"
exit 0
fi
sleep 2
done
echo "ClickHouse failed to become ready"
docker logs "$CONTAINER_ID"
exit 1
- name: Run tests (ClickHouse 26.9)
run: ./vendor/bin/phpunit -c phpunit-ch269.xml
env:
CLICKHOUSE_HOST: 127.0.0.1
CLICKHOUSE_PORT: 8125
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: curl, json
coverage: none
- name: Install dependencies
run: composer install --no-progress --prefer-dist
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse --memory-limit=512M
phpcs:
name: Code Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: curl, json
coverage: none
- name: Install dependencies
run: composer install --no-progress --prefer-dist
- name: Run PHPCS
run: ./vendor/bin/phpcs || true