-
Notifications
You must be signed in to change notification settings - Fork 7.7k
916 lines (916 loc) · 34.6 KB
/
nightly.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
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
name: Nightly
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch: ~
permissions:
contents: read
jobs:
GENERATE_MATRIX:
name: Generate Matrix
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.set-matrix.outputs.branches }}
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
macos-matrix-include: ${{ steps.set-matrix.outputs.macos-matrix-include }}
steps:
- uses: actions/checkout@v4
with:
# Set fetch-depth to 0 to clone the full repository
# including all branches. This is required to find
# the correct commit hashes.
fetch-depth: 0
- name: Grab the commit mapping
uses: actions/cache@v3
with:
path: branch-commit-cache.json
# The cache key needs to change every time for the
# cache to be updated after this job finishes.
key: nightly-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
nightly-
- name: Generate Matrix
id: set-matrix
run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}"
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
LINUX_X64:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
firebird:
image: jacobalberty/firebird
ports:
- 3050:3050
env:
ISC_PASSWORD: test
FIREBIRD_DATABASE: test.fdb
FIREBIRD_USER: test
FIREBIRD_PASSWORD: test
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
configuration_parameters: ['']
debug: [true, false]
name: ['']
run_tests_parameters: ['']
test_function_jit: [true]
zts: [true, false]
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }}
name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-${{ (matrix.branch.version.minor >= 3 && !matrix.asan) && '22.04' || '20.04' }}
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: Create MSSQL container
uses: ./.github/actions/setup-mssql
- name: apt
uses: ./.github/actions/apt-x64
- name: System info
run: |
echo "::group::Show host CPU info"
lscpu
echo "::endgroup::"
echo "::group::Show installed package versions"
dpkg -l
echo "::endgroup::"
- name: ./configure
uses: ./.github/actions/configure-x64
with:
configurationParameters: >-
${{ matrix.configuration_parameters }}
--${{ matrix.debug && 'enable' || 'disable' }}-debug
--${{ matrix.zts && 'enable' || 'disable' }}-zts
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
uses: ./.github/actions/install-linux
- name: Setup
uses: ./.github/actions/setup-x64
- name: Test
uses: ./.github/actions/test-linux
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
idleCpu: ${{ matrix.asan && 'true' || 'false' }}
- name: Test Tracing JIT
uses: ./.github/actions/test-linux
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
jitType: tracing
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Test OpCache
uses: ./.github/actions/test-linux
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Test Function JIT
# ASAN frequently timeouts. Each test run takes ~90 minutes, we can
# avoid running into the 6 hour timeout by skipping the function JIT.
if: matrix.test_function_jit
uses: ./.github/actions/test-linux
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
jitType: function
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
LINUX_X32:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
debug: [true, false]
zts: [true, false]
name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-latest
container:
image: ubuntu:${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
services:
mysql:
image: mysql:8.3
ports:
- 3306:3306
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: root
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: apt
uses: ./.github/actions/apt-x32
- name: System info
run: |
echo "::group::Show host CPU info"
lscpu
echo "::endgroup::"
echo "::group::Show installed package versions"
dpkg -l
echo "::endgroup::"
- name: ./configure
uses: ./.github/actions/configure-x32
with:
configurationParameters: >-
--${{ matrix.debug && 'enable' || 'disable' }}-debug
--${{ matrix.zts && 'enable' || 'disable' }}-zts
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
uses: ./.github/actions/install-linux-x32
- name: Test
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
- name: Test Tracing JIT
uses: ./.github/actions/test-linux
with:
jitType: tracing
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Test OpCache
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Test Function JIT
uses: ./.github/actions/test-linux
with:
jitType: function
runTestsParameters: >-
${{ matrix.run_tests_parameters }}
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
MACOS:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.macos-matrix-include) }}
name: "${{ matrix.branch.name }}_MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: macos-${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: brew
uses: ./.github/actions/brew
- name: ./configure
uses: ./.github/actions/configure-macos
with:
configurationParameters: >-
--${{ matrix.debug && 'enable' || 'disable' }}-debug
--${{ matrix.zts && 'enable' || 'disable' }}-zts
- name: make
run: |-
export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
make -j$(sysctl -n hw.logicalcpu) >/dev/null
- name: make install
run: sudo make install
- name: Test
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
- name: Test Tracing JIT
if: matrix.test_jit
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
jitType: tracing
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Test OpCache
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Test Function JIT
if: matrix.test_jit
uses: ./.github/actions/test-macos
with:
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
jitType: function
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
COVERAGE_DEBUG_NTS:
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
firebird:
image: jacobalberty/firebird
ports:
- 3050:3050
env:
ISC_PASSWORD: test
FIREBIRD_DATABASE: test.fdb
FIREBIRD_USER: test
FIREBIRD_PASSWORD: test
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Create MSSQL container
uses: ./.github/actions/setup-mssql
- name: apt
uses: ./.github/actions/apt-x64
- name: Install gcovr
run: sudo -H pip install gcovr
- name: ./configure
uses: ./.github/actions/configure-x64
with:
configurationParameters: --enable-debug --disable-zts --enable-gcov
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
uses: ./.github/actions/install-linux
- name: Setup
uses: ./.github/actions/setup-x64
# We only test with OpCache, the difference in coverage is negligible
- name: Test OpCache
uses: ./.github/actions/test-linux
with:
jitType: tracing
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Upload Test Coverage to Codecov.io
if: always()
run: bash <(curl -s https://codecov.io/bash)
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
COMMUNITY:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
type: ['asan', 'verify_type_inference']
# These branches don't include type verification
exclude:
- { branch: { name: 'PHP-8.1', ref: 'PHP-8.1', major: 8, minor: 1 }, type: 'verify_type_inference' }
- { branch: { name: 'PHP-8.2', ref: 'PHP-8.2', major: 8, minor: 2 }, type: 'verify_type_inference' }
- { branch: { name: 'PHP-8.3', ref: 'PHP-8.3', major: 8, minor: 3 }, type: 'verify_type_inference' }
name: "${{ matrix.branch.name }}_COMMUNITY_${{ matrix.type }}"
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
env:
ASAN_OPTIONS: exitcode=139
UBSAN_OPTIONS: print_stacktrace=1
USE_ZEND_ALLOC: 0
USE_TRACKED_ALLOC: 1
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: apt
uses: ./.github/actions/apt-x64
- name: ./configure
uses: ./.github/actions/configure-x64
with:
# CFLAGS removes O2, so we have to add it again...
configurationParameters: >-
--enable-zts
${{ matrix.type == 'asan' && '--enable-debug CFLAGS="-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address"' || '' }}
${{ matrix.type == 'verify_type_inference' && 'CFLAGS="-DZEND_VERIFY_TYPE_INFERENCE -O2"' || '' }}
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
uses: ./.github/actions/install-linux
- name: Setup
run: |
sudo service mysql start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
- name: Enable Opcache
run: |
echo memory_limit=-1 >> /etc/php.d/opcache.ini
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
echo opcache.enable=1 >> /etc/php.d/opcache.ini
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini
echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini
echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini
echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini
- name: Enable JIT
if: matrix.type != 'verify_type_inference'
run: |
echo opcache.jit=tracing >> /etc/php.d/opcache.ini
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini
echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini
echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini
echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini
php -v
- name: Test AMPHP
if: always()
run: |
repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server"
X=0
for repository in $repositories; do
printf "Testing amp/%s\n" "$repository"
git clone "https://github.com/amphp/$repository.git" "amphp-$repository" --depth 1
cd "amphp-$repository"
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
vendor/bin/phpunit || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
X=1;
fi
cd ..
done
exit $X
- name: Test Laravel
if: always()
run: |
git clone https://github.com/laravel/framework.git --branch=master --depth=1
cd framework
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
# Hack to disable a test that hangs
php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);'
php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
exit 1
fi
- name: Test ReactPHP
if: always()
run: |
repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream"
X=0
for repository in $repositories; do
printf "Testing reactphp/%s\n" "$repository"
git clone "https://github.com/reactphp/$repository.git" "reactphp-$repository" --depth 1
cd "reactphp-$repository"
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
vendor/bin/phpunit || EXIT_CODE=$?
if [ $[EXIT_CODE:-0} -gt 128 ]; then
X=1;
fi
cd ..
done
exit $X
- name: Test Revolt PHP
if: always()
run: |
git clone https://github.com/revoltphp/event-loop.git --depth=1
cd event-loop
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
vendor/bin/phpunit || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
exit 1
fi
- name: Test Symfony
if: always()
run: |
git clone https://github.com/symfony/symfony.git --depth=1
cd symfony
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
php ./phpunit install
# Test causes a heap-buffer-overflow but I cannot reproduce it locally...
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
# Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
X=0
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
X=1;
fi
done
exit $X
- name: Test PHPUnit
if: always()
run: |
git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1
cd phpunit
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
php ./phpunit || EXIT_CODE=$?
if [ ${EXIT_CODE:-0} -gt 128 ]; then
exit 1
fi
- name: 'Symfony Preloading'
if: always()
run: |
php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs
cd symfony_demo
git rev-parse HEAD
sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php
php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php
- name: Test Wordpress
if: always()
run: |
git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1
cd wordpress
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
cp wp-tests-config-sample.php wp-tests-config.php
sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php
sed -i 's/yourusernamehere/root/g' wp-tests-config.php
sed -i 's/yourpasswordhere/root/g' wp-tests-config.php
php vendor/bin/phpunit || EXIT_CODE=$?
if [ $EXIT_CODE -gt 128 ]; then
exit 1
fi
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
OPCACHE_VARIATION:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
firebird:
image: jacobalberty/firebird
ports:
- 3050:3050
env:
ISC_PASSWORD: test
FIREBIRD_DATABASE: test.fdb
FIREBIRD_USER: test
FIREBIRD_PASSWORD: test
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
name: "${{ matrix.branch.name }}_OPCACHE_VARIATION"
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: Create MSSQL container
uses: ./.github/actions/setup-mssql
- name: apt
uses: ./.github/actions/apt-x64
- name: ./configure
uses: ./.github/actions/configure-x64
with:
configurationParameters: >-
--enable-debug --disable-zts
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
uses: ./.github/actions/install-linux
- name: Setup
uses: ./.github/actions/setup-x64
- name: Test File Cache (prime shm)
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
--file-cache-prime
- name: Test File Cache (prime shm, use shm)
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
--file-cache-use
- name: Test File Cache (prime shm, use file)
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
--file-cache-use
-d opcache.file_cache_only=1
- name: Test File Cache Only (prime)
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
--file-cache-prime
-d opcache.file_cache_only=1
- name: Test File Cache Only (use)
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
--file-cache-use
-d opcache.file_cache_only=1
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
MSAN:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
name: "${{ matrix.branch.name }}_MSAN"
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: apt
uses: ./.github/actions/apt-x64
- name: ./configure
run: |
export CC=clang
export CXX=clang++
export CFLAGS="-DZEND_TRACK_ARENA_ALLOC"
./buildconf --force
# msan requires all used libraries to be instrumented,
# so we should avoiding linking against anything but libc here
./configure \
--enable-debug \
--enable-zts \
--enable-option-checking=fatal \
--prefix=/usr \
--without-sqlite3 \
--without-pdo-sqlite \
--without-libxml \
--disable-dom \
--disable-simplexml \
--disable-xml \
--disable-xmlreader \
--disable-xmlwriter \
--without-pcre-jit \
--disable-opcache-jit \
--enable-phpdbg \
--enable-fpm \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--disable-mysqlnd-compression-support \
--without-pear \
--enable-exif \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
--enable-pcntl \
--enable-mbstring \
--disable-mbregex \
--enable-sockets \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-zend-test \
--enable-werror \
--enable-memory-sanitizer \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--enable-dl-test=shared
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
run: |
sudo make install
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
- name: Setup
run: |
set -x
sudo service mysql start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
# Ensure local_infile tests can run.
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
sudo locale-gen de_DE
- name: Test
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
--msan
- name: Test Opcache
uses: ./.github/actions/test-linux
with:
runTestsParameters: >-
--msan
-d zend_extension=opcache.so
-d opcache.enable_cli=1
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
LIBMYSQLCLIENT:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT"
runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: apt
run: |
sudo apt-get update -y | true
sudo apt install bison re2c
- name: Setup
run: |
sudo service mysql start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
# Ensure local_infile tests can run.
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
- name: Build mysql-8.0
uses: ./.github/actions/build-libmysqlclient
with:
configurationParameters: --enable-werror
libmysql: mysql-8.0.36-linux-glibc2.28-x86_64.tar.xz
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
- name: Test mysql-8.0
uses: ./.github/actions/test-libmysqlclient
with:
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
- name: Build mysql-8.2
uses: ./.github/actions/build-libmysqlclient
with:
configurationParameters: --enable-werror
libmysql: mysql-8.2.0-linux-glibc2.28-x86_64.tar.xz
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
- name: Test mysql-8.2
uses: ./.github/actions/test-libmysqlclient
with:
withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
- name: Verify generated files are up to date
uses: ./.github/actions/verify-generated-files
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
PECL:
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
env:
CC: ccache gcc
CXX: ccache g++
steps:
- name: git checkout PHP
uses: actions/checkout@v4
with:
path: php
- name: git checkout apcu
uses: actions/checkout@v4
with:
repository: krakjoe/apcu
path: apcu
- name: git checkout imagick
uses: actions/checkout@v4
with:
repository: Imagick/imagick
path: imagick
- name: git checkout memcached
uses: actions/checkout@v4
with:
repository: php-memcached-dev/php-memcached
path: memcached
- name: git checkout redis
# Currently fails to build
if: false
uses: actions/checkout@v4
with:
repository: phpredis/phpredis
path: redis
- name: git checkout xdebug
uses: actions/checkout@v4
with:
repository: xdebug/xdebug
path: xdebug
- name: git checkout yaml
uses: actions/checkout@v4
with:
repository: php/pecl-file_formats-yaml
path: yaml
- name: apt
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ccache \
libmemcached-dev \
bison \
re2c
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: "${{github.job}}-${{hashFiles('php/main/php_version.h')}}"
append-timestamp: false
save: ${{ github.event_name != 'pull_request' }}
- name: build PHP
run: |
cd php
./buildconf --force
./configure \
--enable-option-checking=fatal \
--prefix=/opt/php \
--enable-cli \
--disable-all \
--enable-session \
--enable-werror
make -j$(/usr/bin/nproc)
sudo make install
- name: build apcu
run: |
cd apcu
/opt/php/bin/phpize
./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config
make -j$(/usr/bin/nproc)
- name: build imagick
run: |
cd imagick
/opt/php/bin/phpize
./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config
make -j$(/usr/bin/nproc)
- name: build memcached
run: |
cd memcached
/opt/php/bin/phpize
./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config
make -j$(/usr/bin/nproc)
- name: build redis
# Currently fails to build
if: false
run: |
cd redis
/opt/php/bin/phpize
./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config
make -j$(/usr/bin/nproc)
- name: build xdebug
run: |
cd xdebug
/opt/php/bin/phpize
./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config
make -j$(/usr/bin/nproc)
- name: build yaml
run: |
cd yaml
/opt/php/bin/phpize
./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config
make -j$(/usr/bin/nproc)
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
WINDOWS:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: windows-2019
env:
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
PHP_BUILD_OBJ_DIR: C:\obj
PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php_downloads_server_migration_v1
PHP_BUILD_CRT: vs16
PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}"
INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}"
PARALLEL: -j2
OPCACHE: "${{ matrix.opcache && '1' || '0' }}"
steps:
- name: git config
run: git config --global core.autocrlf false && git config --global core.eol lf
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch.ref }}
- name: Setup
uses: ./.github/actions/setup-windows
- name: Build
run: .github/scripts/windows/build.bat
- name: Test
run: .github/scripts/windows/test.bat