-
Notifications
You must be signed in to change notification settings - Fork 17
369 lines (297 loc) · 11.9 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
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
name: Run distribution tests
on:
pull_request:
paths-ignore:
- '**.md'
- 'package.json'
- 'package-lock.json'
schedule:
- cron: '0 6 * * *'
env:
DRUPAL_TESTING_COMPOSER_PROJECT: thunder/thunder-project
DRUPAL_TESTING_COMPOSER_PROJECT_VERSION: "^4.0@stable"
DRUPAL_TESTING_CLEANUP: false
DRUPAL_TESTING_DATABASE_USER: root
DRUPAL_TESTING_DATABASE_PASSWORD: root
DRUPAL_TESTING_TEST_DUMP_FILE: site-dump.tar.gz
DRUPAL_TESTING_DATABASE_ENGINE: mysql
DRUPAL_TESTING_TEST_CODING_STYLES: false
DRUPAL_TESTING_TEST_PROFILE: thunder
DRUPAL_TESTING_HTTP_PORT: 8888
DRUPAL_TESTING_VERBOSE: false
DRUPAL_TESTING_VERSION: "^1.0.42"
DRUPAL_TESTING_TEST_FILTER: ""
DRUPAL_TESTING_SELENIUM_HOST: 127.0.0.1
DRUPAL_TESTING_SELENIUM_PORT: 9515
PHPSTAN_MEMORY_LIMIT: 4G
DRUPAL_TESTING_PARALLEL_TESTING: false
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://127.0.0.1:9515"]'
SIMPLETEST_BASE_URL: http://thunder-testing:8888
BROWSERTEST_OUTPUT_DIRECTORY: /tmp
SKIP_TEST_CLEANUP: true
# The following variable set the version that the upgrade test starts with.
DRUPAL_TESTING_UPGRADE_COMPOSER_PROJECT_VERSION: 3.0.12
DRUPAL_TESTING_UPGRADE_DRUSH_VERSION: 10.3.6
DRUPAL_TESTING_UPGRADE_VERSION: 6.5.4
jobs:
build:
runs-on: ubuntu-24.04
services:
mysql:
image: mariadb:lts
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
strategy:
matrix:
PHP_VERSION: [ '8.1', '8.3' ]
env:
DRUPAL_TESTING_TEST_DEPRECATION: true
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.PHP_VERSION }}
extensions: :redis, Imagick
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-cache-
- name: Get build environment
run: |
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --no-plugins
composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION}
composer global require php-parallel-lint/php-parallel-lint
- name: Lint
run: |
parallel-lint --version
parallel-lint --no-progress -e php,module,install,inc,profile,theme .
- name: Prepare the build
run: test-drupal-project prepare_build
- name: Build the docroot
run: test-drupal-project build
- name: Test for deprecations
run: test-drupal-project deprecation
- name: Install drupal
run: test-drupal-project install
- name: Zip build
run: cd /tmp/test; tar cfz build-${{ matrix.PHP_VERSION }}.tgz thunder; mv build-${{ matrix.PHP_VERSION }}.tgz ${GITHUB_WORKSPACE}
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.PHP_VERSION }}
path: build-${{ matrix.PHP_VERSION }}.tgz
test-max:
needs: build
runs-on: ubuntu-24.04
services:
mysql:
image: mariadb:lts
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
chrome:
image: drupalci/chromedriver:production
options: --add-host=thunder-testing:host-gateway --name chrome
ports:
- 9515:9515
strategy:
fail-fast: false
matrix:
PHP_VERSION: [ '8.3' ]
CHUNK: [ 1, 2, 3 ]
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.PHP_VERSION }}
extensions: :redis, :sodium, Imagick, gd, PDO, mysql, pdo_mysql, mbstring, xmlwriter, pdo, date, dom, filter, hash, json, pcre, session, SimpleXML, SPL, tokenizer, xml, curl
- name: Add host
run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts
- name: Prepare fixtures
run: docker cp ./tests/fixtures chrome:/fixtures
- name: Get build environment
run: |
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --no-plugins
composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION}
- name: Download build
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.PHP_VERSION }}
- name: Unzip build artifact
run: mkdir -p /tmp/test; tar xCfz /tmp/test build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf build-${{ matrix.PHP_VERSION }}
- name: Setup Apache
uses: thunder/apache-shiva-php-action@v1
with:
php-version: ${{ matrix.PHP_VERSION }}
site-directory: /tmp/test/thunder/install/docroot
http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }}
- name: Run tests
run: test-drupal-project run_tests
env:
THUNDER_TEST_CHUNK: ${{ matrix.CHUNK }}
DRUPAL_TESTING_TEST_PATH: /tmp/test/thunder/install/docroot/profiles/contrib/thunder/tests/src/TestSuites/ThunderTestSuite.php
- name: Upload test output
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: text-max-output-${{ matrix.CHUNK }}-${{ matrix.PHP_VERSION }}
path: /tmp/test/thunder/install/docroot/sites/simpletest/browser_output/
test-upgrade:
runs-on: ubuntu-24.04
services:
mysql:
image: mariadb:lts
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
chrome:
image: drupalci/chromedriver:production
options: --add-host=thunder-testing:host-gateway --name chrome
ports:
- 9515:9515
strategy:
matrix:
PHP_VERSION: [ '8.1' ]
if: ${{ contains(github.event.pull_request.labels.*.name, 'test-upgrade') || github.event_name == 'schedule' }}
env:
DRUPAL_TESTING_TEST_GROUP_EXCLUDE: "NoUpdate"
DRUPAL_TESTING_TEST_GROUP: Thunder
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.PHP_VERSION }}
extensions: :redis, Imagick, gd, pdo_mysql
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-cache-
- name: Prepare fixtures
run: docker cp ./tests/fixtures chrome:/fixtures
- name: Add host
run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts
- name: Get build environment
run: |
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --no-plugins
composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION}
- name: Prepare the old install
run: test-drupal-project prepare_old_install
env:
COMPOSER_ROOT_VERSION: ${{ env.DRUPAL_TESTING_UPGRADE_COMPOSER_PROJECT_VERSION }}
- name: Fix the old install
run: |
composer upgrade caxy/php-htmldiff
working-directory: /tmp/test/thunder/install
env:
COMPOSER_ROOT_VERSION: ${{ env.DRUPAL_TESTING_UPGRADE_COMPOSER_PROJECT_VERSION }}
- name: Install drupal
run: test-drupal-project install
env:
COMPOSER_ROOT_VERSION: ${{ env.DRUPAL_TESTING_UPGRADE_COMPOSER_PROJECT_VERSION }}
- name: Prepare the upgrade
run: test-drupal-project prepare_upgrade
env:
COMPOSER_ROOT_VERSION: ${{ env.DRUPAL_TESTING_UPGRADE_COMPOSER_PROJECT_VERSION }}
- name: Update the docroot
run: |
composer remove thunder/thunder-distribution --no-update
composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}"
composer require "drupal-testing-thunder/thunder-distribution:*" --no-update
composer require "drupal/ckeditor" --no-update
composer require "drupal/seven" --no-update
composer require "drupal/entity_browser" --no-update
composer require "drupal/thunder_admin" --no-update
composer require "drupal/shariff" --no-update
composer require "drupal/ctools" --no-update
composer require "drupal/core-dev:~10.0.0" --no-update
composer update
composer exec -- drush updb -y
cd docroot
php core/scripts/db-tools.php dump-database-d8-mysql --database-url "${SIMPLETEST_DB}" >"sites/default/database-dump.php"
tar -czf "${DRUPAL_TESTING_TEST_DUMP_FILE}" --exclude='config_*' --exclude='php' --exclude='styles' --directory='sites/default' files database-dump.php
working-directory: /tmp/test/thunder/install
env:
COMPOSER_ROOT_VERSION: ${{ env.DRUPAL_TESTING_UPGRADE_COMPOSER_PROJECT_VERSION }}
- name: Setup Apache
uses: thunder/apache-shiva-php-action@v1
with:
php-version: ${{ matrix.PHP_VERSION }}
site-directory: /tmp/test/thunder/install/docroot
http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }}
- name: Run tests suite
run: test-drupal-project run_tests
env:
COMPOSER_ROOT_VERSION: ${{ env.DRUPAL_TESTING_UPGRADE_COMPOSER_PROJECT_VERSION }}
test-min:
runs-on: ubuntu-24.04
services:
mysql:
image: mariadb:lts
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
chrome:
image: drupalci/chromedriver:production
options: --add-host=thunder-testing:host-gateway --name chrome
ports:
- 9515:9515
strategy:
matrix:
PHP_VERSION: [ '8.1' ]
if: ${{ contains(github.event.pull_request.labels.*.name, 'test-min') || github.event_name == 'schedule' }}
env:
DRUPAL_TESTING_TEST_GROUP: Thunder
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.PHP_VERSION }}
extensions: :redis, Imagick, gd, pdo_mysql
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-cache-
- name: Prepare fixtures
run: docker cp ./tests/fixtures chrome:/fixtures
- name: Add host
run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts
- name: Get build environment
run: |
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --no-plugins
composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION}
- name: Prepare the build
run: test-drupal-project prepare_build
- name: Install suggested dependencies
run: |
composer require "league/container:^4.2" "drupal/core-dev:^10.3" --no-update --no-progress --working-dir=/tmp/test/thunder/install
composer config allow-plugins.php-http/discovery true --no-plugins --working-dir=/tmp/test/thunder/install
- name: Build the docroot
run: test-drupal-project build
env:
DRUPAL_TESTING_MIN_BUILD: true
- name: Setup Apache
uses: thunder/apache-shiva-php-action@v1
with:
php-version: ${{ matrix.PHP_VERSION }}
site-directory: /tmp/test/thunder/install/docroot
http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }}
- name: Run the tests
run: test-drupal-project run_tests
# Start a debug session.
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3