-
Notifications
You must be signed in to change notification settings - Fork 52
498 lines (427 loc) · 21.3 KB
/
jump-start-config-sets.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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
name: Jump Start Config-Sets
env:
NEXT_MODULE_VERSION: 4.3.5
on:
push:
pull_request:
schedule:
- cron: '0 8 * * *' # run at 08:00 UTC
jobs:
generate-config-sets:
runs-on: ubuntu-24.04
name: Generate Solr jump-start config-sets
env:
COMPOSER_MEMORY_LIMIT: -1
SEARCH_API_SOLR_JUMP_START_CONFIG_SET: 1
steps:
- name: Setup sqlite
run: |
sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, iconv, json, simplexml
ini-values: memory_limit=256M,post_max_size=256M
coverage: none
- name: Checkout drupal
uses: actions/checkout@v4
with:
repository: drupal/drupal
ref: 10.3.x
path: drupal
- name: Checkout search_api_solr
uses: actions/checkout@v4
with:
path: search_api_solr
fetch-depth: 0
- name: Tag search_api_solr
run: |
cd search_api_solr
git tag ${{ env.NEXT_MODULE_VERSION }}
- name: Install dependencies
run: |
cd drupal
php -v
composer config repositories.search_api_solr '{"type": "vcs", "url": "../search_api_solr"}'
composer require drupal/search_api_solr:${{ env.NEXT_MODULE_VERSION }} drush/drush drupal/drush_language --no-interaction
- name: Install drupal
run: |
cd drupal
vendor/bin/drush si minimal --db-url=sqlite://sites/default/files/db.sqlite --yes
vendor/bin/drush en drush_language --yes
vendor/bin/drush language-add ar
vendor/bin/drush language-add bg
vendor/bin/drush language-add ca
vendor/bin/drush language-add cs
vendor/bin/drush language-add cy
vendor/bin/drush language-add da
vendor/bin/drush language-add de
vendor/bin/drush language-add el
vendor/bin/drush language-add es
vendor/bin/drush language-add et
vendor/bin/drush language-add fa
vendor/bin/drush language-add fi
vendor/bin/drush language-add fr
vendor/bin/drush language-add ga
vendor/bin/drush language-add hi
vendor/bin/drush language-add hr
vendor/bin/drush language-add hu
vendor/bin/drush language-add id
vendor/bin/drush language-add it
vendor/bin/drush language-add ja
vendor/bin/drush language-add ko
vendor/bin/drush language-add lv
vendor/bin/drush language-add nb
vendor/bin/drush language-add nl
vendor/bin/drush language-add nn
vendor/bin/drush language-add pl
vendor/bin/drush language-add pt-pt
vendor/bin/drush language-add pt-br
vendor/bin/drush language-add ro
vendor/bin/drush language-add ru
vendor/bin/drush language-add sk
vendor/bin/drush language-add sr
vendor/bin/drush language-add sv
vendor/bin/drush language-add th
vendor/bin/drush language-add tr
vendor/bin/drush language-add uk
vendor/bin/drush language-add zh-hans
vendor/bin/drush language-add zh-hant
vendor/bin/drush en search_api_solr_legacy,config --yes
vendor/bin/drush cim --partial --source=modules/contrib/search_api_solr/jump-start/drupal_configs --yes
- name: Generate config-sets
run: |
cd drupal
vendor/bin/drush -v solr-gsc solr_36 config.zip 3.6
rm ../search_api_solr/jump-start/solr3/config-set/*
unzip -o -d ../search_api_solr/jump-start/solr3/config-set config.zip
vendor/bin/drush -v solr-gsc solr config.zip 4.5
rm ../search_api_solr/jump-start/solr4/config-set/*
unzip -o -d ../search_api_solr/jump-start/solr4/config-set config.zip
vendor/bin/drush -v solr-gsc solr config.zip 5
rm ../search_api_solr/jump-start/solr5/config-set/*
unzip -o -d ../search_api_solr/jump-start/solr5/config-set config.zip
vendor/bin/drush -v solr-gsc solr config.zip 6
rm ../search_api_solr/jump-start/solr6/config-set/*
unzip -o -d ../search_api_solr/jump-start/solr6/config-set config.zip
vendor/bin/drush -v solr-gsc solr config.zip 7
rm ../search_api_solr/jump-start/solr7/config-set/*
unzip -o -d ../search_api_solr/jump-start/solr7/config-set config.zip
vendor/bin/drush -v solr-gsc solr config.zip 8
rm ../search_api_solr/jump-start/solr8/config-set/*
unzip -o -d ../search_api_solr/jump-start/solr8/config-set config.zip
vendor/bin/drush -v solr-gsc solr config.zip 9
rm ../search_api_solr/jump-start/solr9/config-set/*
unzip -o -d ../search_api_solr/jump-start/solr9/config-set config.zip
vendor/bin/drush -v solr-gsc solr_cloud config.zip 4.5
rm ../search_api_solr/jump-start/solr4/cloud-config-set/*
unzip -o -d ../search_api_solr/jump-start/solr4/cloud-config-set config.zip
vendor/bin/drush -v solr-gsc solr_cloud config.zip 5
rm ../search_api_solr/jump-start/solr5/cloud-config-set/*
unzip -o -d ../search_api_solr/jump-start/solr5/cloud-config-set config.zip
vendor/bin/drush -v solr-gsc solr_cloud config.zip 6
rm ../search_api_solr/jump-start/solr6/cloud-config-set/*
unzip -o -d ../search_api_solr/jump-start/solr6/cloud-config-set config.zip
vendor/bin/drush -v solr-gsc solr_cloud config.zip 7
rm ../search_api_solr/jump-start/solr7/cloud-config-set/*
unzip -o -d ../search_api_solr/jump-start/solr7/cloud-config-set config.zip
vendor/bin/drush -v solr-gsc solr_cloud config.zip 8
rm ../search_api_solr/jump-start/solr8/cloud-config-set/*
unzip -o -d ../search_api_solr/jump-start/solr8/cloud-config-set config.zip
vendor/bin/drush -v solr-gsc solr_cloud config.zip 9
rm ../search_api_solr/jump-start/solr9/cloud-config-set/*
unzip -o -d ../search_api_solr/jump-start/solr9/cloud-config-set config.zip
- uses: actions/upload-artifact@v4
with:
name: jump-start-config-sets
path: search_api_solr/jump-start
run-tests:
runs-on: ubuntu-24.04
needs: generate-config-sets
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
drupal: ['10.3']
solr: ['4', '5', '6', '7', '8', '9']
php: ['8.2', '8.3']
solarium: ['solarium/solarium:"dev-master as 6.3.99"']
experimental: [false]
include:
- drupal: '11.0'
solr: '9'
php: '8.3'
solarium: 'solarium/solarium'
experimental: true
name: Drupal ${{ matrix.drupal }}, Solr ${{ matrix.solr }}, PHP ${{ matrix.php }}
env:
COMPOSER_MEMORY_LIMIT: -1
steps:
- name: Setup sqlite
run: |
sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, iconv, json, simplexml
ini-values: memory_limit=256M,post_max_size=256M
coverage: none
- uses: actions/download-artifact@v4
with:
name: jump-start-config-sets
path: solr
- name: Start Solr ${{ matrix.solr }}
run: |
cd solr/solr${{ matrix.solr }}
cat docker-compose.yml
docker compose up -d
- name: Checkout drupal
uses: actions/checkout@v4
with:
repository: drupal/drupal
ref: ${{ matrix.drupal }}.x
path: drupal
- name: Checkout search_api_solr
uses: actions/checkout@v4
with:
path: search_api_solr
fetch-depth: 0
- name: Tag search_api_solr
run: |
cd search_api_solr
git tag ${{ env.NEXT_MODULE_VERSION }}
- name: Install dependencies
run: |
cd drupal
php -v
composer config platform.php ${{ matrix.php }}.0
composer config repositories.search_api_solr '{"type": "vcs", "url": "../search_api_solr"}'
composer require ${{ matrix.solarium }} drupal/search_api_solr:${{ env.NEXT_MODULE_VERSION }} drupal/search_api_autocomplete:1.x-dev drupal/search_api_spellcheck:4.0.x-dev drupal/facets:3.0.x-dev drupal/devel drupal/search_api_location:1.x-dev drupal/geofield drush/drush monolog/monolog --no-interaction
# search_api was installed as dependency above. This is a required check! Now switch to the latest dev version.
composer require drupal/search_api:1.x-dev --no-interaction
# cd modules/contrib/search_api
# wget https://www.drupal.org/files/issues/2022-11-04/3318187-19--fix_views_filter_regressions.patch
# patch -p1 < 3318187-19--fix_views_filter_regressions.patch
# cd -
- name: Create Solr collections
run: |
docker ps
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 wait-for-solr.sh
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 bin/solr create -c techproducts -s 2 -rf 1 -d server/solr/configsets/sample_techproducts_configs/conf -n sample_techproducts_configs
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 bash -c "bin/post -c techproducts example/exampledocs/*.xml"
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 bin/solr create -c checkpoints -s 1 -rf 1
- name: Run tests
env:
SOLR_INDEX_WAIT: 4
SOLR_CLOUD: true
SYMFONY_DEPRECATIONS_HELPER: disabled
run: |
cp search_api_solr/tests/github.phpunit.xml drupal/core/phpunit.xml.dist
cd drupal
php -S localhost:8888 >& /dev/null &
vendor/bin/drush si standard --db-url=sqlite://sites/default/files/db.sqlite --yes
vendor/bin/drush en search_api_solr_admin,search_api_solr_devel,search_api_solr_legacy,search_api_spellcheck,search_api_solr_autocomplete,facets,search_api_location --yes
vendor/bin/phpunit -v -c core --group search_api_solr --exclude-group not_drupal${{ matrix.drupal }},not_solr${{ matrix.solr }} modules/contrib/search_api_solr
vendor/bin/drush cim --partial --source=modules/contrib/search_api_solr/jump-start/drupal_configs --yes
vendor/bin/drush -v solr-gsc solr_cloud test-config-generation.zip
vendor/bin/drush -v cron
run-d11-tests:
runs-on: ubuntu-24.04
needs: generate-config-sets
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
drupal: ['11.0']
solr: ['4', '5', '6', '7', '8', '9']
php: ['8.3']
solarium: ['solarium/solarium:"dev-master as 6.3.99"']
experimental: [true]
name: Drupal ${{ matrix.drupal }}, Solr ${{ matrix.solr }}, PHP ${{ matrix.php }}
env:
COMPOSER_MEMORY_LIMIT: -1
steps:
- name: Setup sqlite
run: |
sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, iconv, json, simplexml
ini-values: memory_limit=256M,post_max_size=256M
coverage: none
- uses: actions/download-artifact@v4
with:
name: jump-start-config-sets
path: solr
- name: Start Solr ${{ matrix.solr }}
run: |
cd solr/solr${{ matrix.solr }}
cat docker-compose.yml
docker compose up -d
- name: Checkout drupal
uses: actions/checkout@v4
with:
repository: drupal/drupal
ref: ${{ matrix.drupal }}.x
path: drupal
- name: Checkout search_api_solr
uses: actions/checkout@v4
with:
path: search_api_solr
fetch-depth: 0
- name: Tag search_api_solr
run: |
cd search_api_solr
git tag ${{ env.NEXT_MODULE_VERSION }}
- name: Install dependencies
run: |
cd drupal
php -v
composer config platform.php ${{ matrix.php }}.0
composer config repositories.search_api_solr '{"type": "vcs", "url": "../search_api_solr"}'
composer require ${{ matrix.solarium }} drupal/search_api_solr:${{ env.NEXT_MODULE_VERSION }} drupal/search_api_autocomplete:1.x-dev drupal/search_api_spellcheck:4.0.x-dev drush/drush monolog/monolog --no-interaction
# search_api was installed as dependency above. This is a required check! Now switch to the latest dev version.
composer require drupal/search_api:1.x-dev --no-interaction
# cd modules/contrib/search_api
# wget https://www.drupal.org/files/issues/2022-11-04/3318187-19--fix_views_filter_regressions.patch
# patch -p1 < 3318187-19--fix_views_filter_regressions.patch
# cd -
- name: Create Solr collections
run: |
docker ps
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 wait-for-solr.sh
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 bin/solr create -c techproducts -s 1 -rf 1 -d server/solr/configsets/sample_techproducts_configs/conf -n sample_techproducts_configs
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 bash -c "bin/post -c techproducts example/exampledocs/*.xml"
docker exec solr${{ matrix.solr }}-solr${{ matrix.solr }}-1 bin/solr create -c checkpoints -s 1 -rf 1
- name: Run tests
env:
SOLR_INDEX_WAIT: 4
SOLR_CLOUD: true
SYMFONY_DEPRECATIONS_HELPER: disabled
run: |
cp search_api_solr/tests/github.phpunit.d11.xml drupal/core/phpunit.xml.dist
cd drupal
# Workaround until these modules are D11 compatible.
rm modules/contrib/search_api_solr/tests/src/Functional/FacetsTest.php
rm modules/contrib/search_api_solr/modules/search_api_solr_legacy/tests/src/Functional/FacetsTest.php
rm modules/contrib/search_api_solr/tests/src/Kernel/SearchApiSolrLocationTest.php
php -S localhost:8888 >& /dev/null &
vendor/bin/drush si standard --db-url=sqlite://sites/default/files/db.sqlite --yes
vendor/bin/drush en search_api_solr_admin,search_api_solr_legacy,search_api_spellcheck,search_api_solr_autocomplete --yes
vendor/bin/phpunit -c core --group search_api_solr --exclude-group not_drupal${{ matrix.drupal }},not_solr${{ matrix.solr }} modules/contrib/search_api_solr
vendor/bin/drush cim --partial --source=modules/contrib/search_api_solr/jump-start/drupal_configs --yes
vendor/bin/drush -v solr-gsc solr_cloud test-config-generation.zip
vendor/bin/drush -v cron
run-legacy-tests:
runs-on: ubuntu-24.04
needs: generate-config-sets
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
drupal: ['10.3']
solr: ['3']
php: ['8.2', '8.3']
experimental: [false]
name: Drupal ${{ matrix.drupal }}, Solr ${{ matrix.solr }}, PHP ${{ matrix.php }}
env:
COMPOSER_MEMORY_LIMIT: -1
steps:
- name: Setup sqlite
run: |
sudo apt-get update
sudo apt-get install sqlite3 libsqlite3-dev
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, iconv, json, simplexml
ini-values: memory_limit=256M,post_max_size=256M
coverage: none
- uses: actions/download-artifact@v4
with:
name: jump-start-config-sets
path: solr
- name: Start Solr ${{ matrix.solr }}
run: |
cd solr/solr${{ matrix.solr }}
docker compose up -d
- name: Checkout drupal
uses: actions/checkout@v4
with:
repository: drupal/drupal
ref: ${{ matrix.drupal }}.x
path: drupal
- name: Checkout search_api_solr
uses: actions/checkout@v4
with:
path: search_api_solr
fetch-depth: 0
- name: Tag search_api_solr
run: |
cd search_api_solr
git tag ${{ env.NEXT_MODULE_VERSION }}
- name: Install dependencies
run: |
cd drupal
php -v
composer config platform.php ${{ matrix.php }}.0
composer config repositories.search_api_solr '{"type": "vcs", "url": "../search_api_solr"}'
composer require drupal/search_api_solr:${{ env.NEXT_MODULE_VERSION }} drupal/search_api_autocomplete:1.x-dev drupal/search_api_spellcheck:4.0.x-dev drupal/facets:3.0.x-dev drupal/devel drupal/search_api_location:1.x-dev drupal/geofield drush/drush monolog/monolog --no-interaction
# search_api was installed as dependency above. This is a required check! Now switch to the latest dev version.
composer require drupal/search_api:1.x-dev --no-interaction
# cd modules/contrib/search_api
# wget https://www.drupal.org/files/issues/2022-11-04/3318187-19--fix_views_filter_regressions.patch
# patch -p1 < 3318187-19--fix_views_filter_regressions.patch
# cd -
- name: Run legacy tests
env:
SOLR_INDEX_WAIT: 4
SOLR_CLOUD: false
SYMFONY_DEPRECATIONS_HELPER: disabled
run: |
cp search_api_solr/tests/github.phpunit.xml drupal/core/phpunit.xml.dist
cd drupal
php -S localhost:8888 >& /dev/null &
vendor/bin/drush si standard --db-url=sqlite://sites/default/files/db.sqlite --yes
vendor/bin/drush en search_api_solr_admin,search_api_solr_devel,search_api_solr_legacy --yes
vendor/bin/phpunit -v -c core --group search_api_solr_legacy --exclude-group not_drupal${{ matrix.drupal }},not_solr${{ matrix.solr }} modules/contrib/search_api_solr/modules/search_api_solr_legacy
vendor/bin/drush cim --partial --source=modules/contrib/search_api_solr/jump-start/drupal_configs --yes
vendor/bin/drush -v solr-gsc solr_36 test-config-generation.zip
vendor/bin/drush -v cron
push-config-sets:
runs-on: ubuntu-latest
name: Push updated Solr jump-start config-sets
needs: [run-tests, run-legacy-tests]
steps:
- name: Checkout search_api_solr
uses: actions/checkout@v4
with:
path: search_api_solr
fetch-depth: 0
- name: Remove old config-sets
run: |
cd search_api_solr/jump-start
rm -rf *
- uses: actions/download-artifact@v4
with:
name: jump-start-config-sets
path: search_api_solr/jump-start
- name: Commit new config-sets
run: |
cd search_api_solr
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git pull
git add *
git commit -m "Solr jump-start config-set change" || echo "Nothing to update"
- name: Push config-sets
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: search_api_solr
branch: ${{ github.ref }}