-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
1284 lines (1115 loc) · 41.7 KB
/
Copy pathmain.yml
File metadata and controls
1284 lines (1115 loc) · 41.7 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
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
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is part of Phalcon.
#
# (c) Phalcon Team <team@phalcon.io>
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.
name: Phalcon CI
on:
push:
paths-ignore:
- '**.md'
- '**.txt'
pull_request:
workflow_dispatch:
env:
# All versions should be declared here
PHALCON_VERSION: 5.20.3
# For tests
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
# Windows specific
TOOLS_DIR: 'C:\tools'
CACHE_DIR: 'C:\Downloads'
PHP_VERSION_LIST: '8.1, 8.2, 8.3, 8.4, 8.5'
ARCH_LIST: 'x64, x86'
TS_LIST: 'nts, ts'
# PHP extensions required by Composer
EXTENSIONS: apcu, gettext, gd, igbinary, imagick, intl, json, mbstring, msgpack, memcached, pcov, sqlite3, yaml, redis, :memcache, openssl
# Schema fixtures (talon schema). These mirror the entries in
# tests/support/_config/.env.default; talon does not load .env, so the
# schema command needs them in the process environment.
schema_source: tests/support/Migrations
schema_namespace: 'Phalcon\Tests\Support\Migrations'
schema_output: tests/support/assets/schema
schema_pre: 'Phalcon\Tests\Support\Migrations\BootstrapMigration'
schema_post: 'Phalcon\Tests\Support\Migrations\FooterMigration'
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
# PHP CodeSniffer - gates build-and-test and database_test
phpcs:
permissions:
contents: read
name: Check code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.5'
- name: Install dependencies
run: composer install --prefer-dist --ignore-platform-reqs
- name: Run PHP_CodeSniffer
run: composer cs
# Generate IDE stubs, validate with Psalm, fix code style and store as artifact
stubs:
permissions:
contents: read
name: Stubs
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.5'
- name: Install System Dependencies
run: |
sudo apt-get update --quiet --yes 1>/dev/null
sudo apt-get install --no-install-recommends -q -y re2c
- run: composer install --prefer-dist --ignore-platform-reqs
- name: Generate and validate stubs
run: |
vendor/bin/zephir stubs
composer analyze
- name: Fix code style on generated stubs
# phpcbf exits 1 when it fixes files; passing the path on the CLI overrides
# the <file> entries in phpcs.xml so the PSR12 ruleset is applied to the stubs.
run: vendor/bin/phpcbf --standard=resources/phpcs.xml ide/${{ env.PHALCON_VERSION }}/ || true
- name: Upload IDE stubs artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: phalcon-ide-stubs
path: ide/${{ env.PHALCON_VERSION }}/Phalcon/
retention-days: 5
# Build Phalcon PECL package (kept available alongside PIE for a few
# releases to give downstream users time to migrate to PIE).
generate_pecl:
name: Build Phalcon PECL package
needs: [phpcs, stubs]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.5'
tools: pecl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup APT Repositories
run: |
# Remove Microsoft repos - our builds often fail due to
# unstable/offline Microsoft servers.
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list
sudo rm -f /etc/apt/sources.list.d/azure*.list
- name: Install System Dependencies
run: |
sudo apt-get update --quiet --yes 1>/dev/null
sudo apt-get install --no-install-recommends -q -y re2c
- run: composer install --ignore-platform-reqs
- name: Generate C Code
run: |
vendor/bin/zephir fullclean
vendor/bin/zephir generate
(cd build && php gen-build.php)
- name: Upload compile-errors.log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: failure()
with:
name: compile-errors
path: compile-errors.log
- name: Create Pecl Package
id: pecl_create
run: |
cp build/phalcon/config.w32 config.w32
cp build/phalcon/phalcon.zep.c phalcon.zep.c
cp build/phalcon/config.m4 config.m4
cp build/phalcon/php_phalcon.h php_phalcon.h
cp build/phalcon/phalcon.zep.h phalcon.zep.h
pecl package
phalcon_package="`ls | grep phalcon-*tgz`"
mv $phalcon_package phalcon-pecl.tgz
- name: Validate Pecl Package
run: pecl package-validate phalcon-pecl.tgz
- name: Upload Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: 'phalcon-pecl'
path: phalcon-pecl.tgz
# Generate fresh C source from Zephir, build the extension, and cache
# the source tree and compiled .so for all downstream jobs.
generate_source:
permissions:
contents: read
name: Generate source / PHP ${{ matrix.php }}
needs: [phpcs, stubs]
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup APT Repositories
run: |
# Remove Microsoft repos - our builds often fail due to
# unstable/offline Microsoft servers.
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list
sudo rm -f /etc/apt/sources.list.d/azure*.list
- name: Install System Dependencies
run: |
sudo apt-get update --quiet --yes 1>/dev/null
sudo apt-get install --no-install-recommends -q -y re2c
- run: composer install --ignore-platform-reqs
- name: Generate C Code
run: |
vendor/bin/zephir fullclean
vendor/bin/zephir generate
(cd build && php gen-build.php)
- name: Upload compile-errors.log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: failure()
with:
name: compile-errors
path: compile-errors.log
- name: Upload source artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: phalcon-source-php${{ matrix.php }}
path: build/phalcon/
retention-days: 1
- name: Build extension (smoke test)
run: |
cd build/phalcon
phpize
./configure --enable-phalcon
make -j"$(nproc)"
# Validate PIE metadata and confirm the extension builds from the
# generated source tree that PIE would use.
pie_smoke_test:
permissions:
contents: read
name: PIE smoke test / PHP ${{ matrix.php }}
runs-on: ubuntu-latest
needs: [generate_source]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
tools: phpize, php-config
- name: Validate PIE metadata
run: |
TYPE=$(php -r 'echo json_decode(file_get_contents("composer.json"))->type;')
EXT_NAME=$(php -r 'echo json_decode(file_get_contents("composer.json"))->{"php-ext"}->{"extension-name"};')
BUILD_PATH=$(php -r 'echo json_decode(file_get_contents("composer.json"))->{"php-ext"}->{"build-path"};')
if [ "$TYPE" != "php-ext" ]; then echo "::error::composer.json type must be php-ext, got: $TYPE"; exit 1; fi
if [ "$EXT_NAME" != "phalcon" ]; then echo "::error::extension-name must be phalcon, got: $EXT_NAME"; exit 1; fi
if [ "$BUILD_PATH" != "build/phalcon" ]; then echo "::error::build-path must be build/phalcon, got: $BUILD_PATH"; exit 1; fi
echo "PIE metadata OK: type=$TYPE, extension-name=$EXT_NAME, build-path=$BUILD_PATH"
- name: Download source artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: phalcon-source-php${{ matrix.php }}
path: ./phalcon-source
- name: Build extension from source (same path PIE uses)
run: |
cd phalcon-source
phpize
./configure --enable-phalcon
make -j"$(nproc)"
- name: Validate extension loads
run: php -d extension=phalcon-source/modules/phalcon.so -r 'echo "phalcon " . (new Phalcon\Support\Version())->get() . PHP_EOL;'
# Verify the extension installs cleanly via the PIE build path
install:
name: Install / PHP ${{ matrix.php }}
runs-on: ubuntu-latest
needs: [generate_source]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
tools: phpize, php-config
- name: Download source artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: phalcon-source-php${{ matrix.php }}
path: ./build/phalcon
- name: Install extension (PIE path)
run: |
cd build/phalcon
phpize
./configure --enable-phalcon
make -j"$(nproc)"
sudo make install
- name: Validate extension
run: php -d extension=phalcon -r 'echo (new Phalcon\Support\Version())->get();' || exit 1
build_extension:
permissions:
contents: read
name: Build / PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}
needs: [generate_source]
runs-on: ${{ matrix.os }}
# TODO: Remove this continue-on-error once shivammathur/homebrew-php
# republishes the php@8.5 bottle for macOS arm64. As of 2026-06-08 the
# Setup PHP step (brew install php@8.5) fails on macOS arm64 because
# Homebrew core moved ahead of the tap's php@8.5 bottle. This is an
# upstream environment issue, not a cphalcon problem, and affects all
# branches. Drop this line when the macOS 8.5 builds go green again.
continue-on-error: ${{ matrix.name == 'macos-clang' && matrix.php == '8.5' }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
ts:
- 'nts'
- 'ts'
arch:
- 'x64'
- 'arm64'
name:
- ubuntu-gcc
- macos-clang
exclude:
- { name: macos-clang, arch: x64 }
include:
- { name: ubuntu-gcc, arch: x64, os: ubuntu-22.04, compiler: gcc }
- { name: ubuntu-gcc, arch: arm64, os: ubuntu-22.04-arm, compiler: gcc }
- { name: macos-clang, arch: arm64, os: macos-14, compiler: clang }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: Setup platform specific environment
shell: pwsh
run: |
git config --global core.autocrlf false
$SessionSavePath = if ("${{ runner.os }}" -eq "Windows") { 'C:\temp' } else { '/tmp' }
Write-Output "SESSION_SAVE_PATH=$SessionSavePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=${{ env.SESSION_SAVE_PATH }}, register_argc_argv=on
tools: phpize, php-config
env:
PHPTS: ${{ matrix.ts }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download source artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: phalcon-source-php${{ matrix.php }}
path: ./phalcon-source
- name: Build Phalcon Extension (Linux)
if: runner.os == 'Linux'
id: linux-build
uses: ./.github/actions/build-phalcon-linux
with:
source: ./phalcon-source
php-version: ${{ matrix.php }}
- name: Upload compiled Phalcon extension (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: phalcon-so-php${{ matrix.php }}-${{ matrix.ts }}-linux-${{ matrix.arch }}
path: ${{ steps.linux-build.outputs.extension-dir }}/phalcon.so
retention-days: 1
- name: Build Phalcon Extension (macOS)
if: runner.os == 'macOS'
uses: ./.github/actions/build-phalcon-macos
with:
source: ./phalcon-source
- name: Build Phalcon Extension (Windows)
if: runner.os == 'Windows'
uses: ./.github/actions/build-phalcon-win
with:
source: ./phalcon-source
php-version: ${{ matrix.php }}
ts: ${{ matrix.ts }}
compiler: ${{ matrix.compiler }}
arch: ${{ matrix.arch }}
phalcon-version: ${{ env.PHALCON_VERSION }}
tools-dir: ${{ env.TOOLS_DIR }}
cache-dir: ${{ env.CACHE_DIR }}
os: ${{ matrix.os }}
- name: Pack Phalcon Extension
shell: pwsh
run: |
if ( "${{ runner.os }}" -eq 'Windows' ) {
$ReleaseFolder = if ("${{ matrix.ts }}" -eq "ts") { "Release_TS" } else { "Release" }
$ReleaseFolder = if ("${{ matrix.arch }}" -eq "x64") { "x64\${ReleaseFolder}" } else { "${ReleaseFolder}" }
$ExtPath = "phalcon-source\${ReleaseFolder}\php_phalcon.dll"
} else {
$ExtPath = "$(php-config --extension-dir)/phalcon.so"
}
if ([string]::IsNullOrEmpty($ExtPath) -or -not (Test-Path $ExtPath)) {
Write-Error "Phalcon extension not found at: '$ExtPath'"
exit 1
}
$TargetName = "phalcon-php${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}"
$Destination = "./build-artifacts"
if (-not (Test-Path -Path $Destination -PathType Container)) {
New-Item $Destination -ItemType Directory | Out-Null
}
Copy-Item -Path $ExtPath -Destination $Destination
Copy-Item -Path "./3rdparty/licenses/*.txt" -Destination $Destination
Set-Location $Destination
& 7z a "$TargetName.zip" *
- name: Upload Phalcon Extension Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: phalcon-php${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}.zip
path: ./build-artifacts/phalcon*.zip
retention-days: 30
unit_test:
permissions:
contents: read
name: Unit / PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}
needs: [build_extension]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
services:
redis:
image: redis:8-alpine
ports:
- "6379:6379"
memcached:
image: memcached:1.6-alpine
ports:
- "11211:11211"
beanstalkd:
image: schickling/beanstalkd:latest
ports:
- "11300:11300"
strategy:
fail-fast: true
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
ts:
- 'nts'
- 'ts'
arch:
- 'x64'
name:
- ubuntu-gcc
include:
- { name: ubuntu-gcc, os: ubuntu-22.04, compiler: gcc }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
token: ${{ github.token }}
- name: Setup platform specific environment
shell: pwsh
run: |
git config --global core.autocrlf false
$SessionSavePath = if ("${{ runner.os }}" -eq "Windows") { 'C:\temp' } else { '/tmp' }
Write-Output "SESSION_SAVE_PATH=$SessionSavePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Redis Cluster
uses: vishnudxb/redis-cluster@e29c352fa58527003afc982e96db437c0c49e6aa # 1.10.0
with:
master1-port: 5000
master2-port: 5001
master3-port: 5002
slave1-port: 5003
slave2-port: 5004
slave3-port: 5005
sleep-duration: 5
- name: Test Redis Cluster
run: |
sudo apt-get update
sudo apt-get install -y redis-tools
docker ps -a
redis-cli -h 127.0.0.1 -p 5000 ping
redis-cli -h 127.0.0.1 -p 5000 cluster nodes
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=${{ env.SESSION_SAVE_PATH }}, register_argc_argv=on
tools: phpize, php-config
env:
PHPTS: ${{ matrix.ts }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download compiled Phalcon extension
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: phalcon-so-php${{ matrix.php }}-${{ matrix.ts }}-linux-x64
path: ./phalcon-so
- name: Install Phalcon extension
# talon.php loads the extension from ext/modules/phalcon.so, so the
# artifact goes there rather than into the system extension dir; CI
# then loads it exactly the way local development does.
shell: bash
run: |
mkdir -p ext/modules
cp ./phalcon-so/phalcon.so ext/modules/phalcon.so
php -d extension=ext/modules/phalcon.so --ri phalcon
- name: Validate composer
run: composer validate --no-check-all --no-check-publish
- name: Install development dependencies with Composer
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
with:
composer-options: "--prefer-dist --ignore-platform-reqs"
- name: Setup Tests
shell: bash
run: |
if [ "${{ runner.os }}" = "Linux" ]; then
./resources/linux-setup-locales.sh
fi
cp tests/support/_config/.env.default .env
vendor/bin/talon schema
- name: Run Unit Tests
run: composer test-unit
- name: Check Release notes parser
shell: bash
run: |
echo "-- Creating Release Notes"
./resources/release-notes.sh ./CHANGELOG-5.0.md
database_mariadb_test:
permissions:
contents: read
name: Db MariaDB / PHP-${{ matrix.php }}
needs: [build_extension]
runs-on: ubuntu-latest
timeout-minutes: 60
services:
mariadb:
image: mariadb:10.6
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: secret
MYSQL_USER: phalcon
MYSQL_DATABASE: phalcon
MYSQL_PASSWORD: secret
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:8-alpine
ports:
- "6379:6379"
memcached:
image: memcached:1.6-alpine
ports:
- "11211:11211"
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: "Setup platform specific environment"
shell: pwsh
run: git config --global core.autocrlf false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=/tmp, register_argc_argv=on
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download compiled Phalcon extension
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: phalcon-so-php${{ matrix.php }}-nts-linux-x64
path: ./phalcon-so
- name: Install Phalcon extension
# talon.php loads the extension from ext/modules/phalcon.so, so the
# artifact goes there rather than into the system extension dir; CI
# then loads it exactly the way local development does.
shell: bash
run: |
mkdir -p ext/modules
cp ./phalcon-so/phalcon.so ext/modules/phalcon.so
php -d extension=ext/modules/phalcon.so --ri phalcon
- name: Validate composer
run: composer validate --no-check-all --no-check-publish
- name: Install development dependencies with Composer
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
with:
composer-options: "--prefer-dist --ignore-platform-reqs"
- name: Setup Tests
shell: bash
run: |
if [ "${{ runner.os }}" = "Linux" ]; then
./resources/linux-setup-locales.sh
fi
cp tests/support/_config/.env.default .env
vendor/bin/talon schema
- name: Run Database Tests (MariaDB)
env:
DATA_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }}
DATA_MARIADB_USER: root
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
run: composer test-db-mariadb
database_mysql_test:
permissions:
contents: read
name: Db MySQL / PHP-${{ matrix.php }}
needs: [build_extension]
runs-on: ubuntu-latest
timeout-minutes: 60
services:
mysql:
image: mysql:8.0
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: secret
MYSQL_USER: phalcon
MYSQL_DATABASE: phalcon
MYSQL_PASSWORD: secret
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:8-alpine
ports:
- "6379:6379"
memcached:
image: memcached:1.6-alpine
ports:
- "11211:11211"
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: "Setup platform specific environment"
shell: pwsh
run: git config --global core.autocrlf false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=/tmp, register_argc_argv=on
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download compiled Phalcon extension
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: phalcon-so-php${{ matrix.php }}-nts-linux-x64
path: ./phalcon-so
- name: Install Phalcon extension
# talon.php loads the extension from ext/modules/phalcon.so, so the
# artifact goes there rather than into the system extension dir; CI
# then loads it exactly the way local development does.
shell: bash
run: |
mkdir -p ext/modules
cp ./phalcon-so/phalcon.so ext/modules/phalcon.so
php -d extension=ext/modules/phalcon.so --ri phalcon
- name: Validate composer
run: composer validate --no-check-all --no-check-publish
- name: Install development dependencies with Composer
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
with:
composer-options: "--prefer-dist --ignore-platform-reqs"
- name: Setup Tests
shell: bash
run: |
if [ "${{ runner.os }}" = "Linux" ]; then
./resources/linux-setup-locales.sh
fi
cp tests/support/_config/.env.default .env
vendor/bin/talon schema
- name: Run Database Tests (MySQL)
env:
DATA_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
DATA_MYSQL_USER: root
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
run: composer test-db-mysql
database_sqlite_test:
permissions:
contents: read
name: Db Sqlite/ PHP-${{ matrix.php }}
needs: [build_extension]
runs-on: ubuntu-latest
timeout-minutes: 60
services:
redis:
image: redis:8-alpine
ports:
- "6379:6379"
memcached:
image: memcached:1.6-alpine
ports:
- "11211:11211"
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 1
token: ${{ github.token }}
- name: "Setup platform specific environment"
shell: pwsh
run: git config --global core.autocrlf false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=/tmp, register_argc_argv=on
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download compiled Phalcon extension
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: phalcon-so-php${{ matrix.php }}-nts-linux-x64
path: ./phalcon-so
- name: Install Phalcon extension
# talon.php loads the extension from ext/modules/phalcon.so, so the
# artifact goes there rather than into the system extension dir; CI
# then loads it exactly the way local development does.
shell: bash
run: |
mkdir -p ext/modules
cp ./phalcon-so/phalcon.so ext/modules/phalcon.so
php -d extension=ext/modules/phalcon.so --ri phalcon
- name: Validate composer
run: composer validate --no-check-all --no-check-publish
- name: Install development dependencies with Composer
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
with:
composer-options: "--prefer-dist --ignore-platform-reqs"
- name: Setup Tests
shell: bash
run: |
if [ "${{ runner.os }}" = "Linux" ]; then
./resources/linux-setup-locales.sh
fi
cp tests/support/_config/.env.default .env
vendor/bin/talon schema
- name: Run Database Tests (SQLite)
env:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
run: composer test-db-sqlite
database_pgsql_test:
permissions:
contents: read
name: Db Postgres / PHP-${{ matrix.php }}
needs: [build_extension]
runs-on: ubuntu-latest
timeout-minutes: 60
services:
postgres:
image: postgres:18-alpine
ports:
- "5432:5432"
env:
POSTGRES_USER: phalcon
POSTGRES_PASSWORD: secret
POSTGRES_DB: phalcon
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:8-alpine
ports:
- "6379:6379"
memcached:
image: memcached:1.6-alpine
ports:
- "11211:11211"
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}