-
Notifications
You must be signed in to change notification settings - Fork 11
770 lines (756 loc) · 25.8 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
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
name: tests
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
source:
runs-on: ubuntu-22.04
outputs:
extension_version: ${{ steps.build_extension.outputs.extension_version }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- uses: hendrikmuhs/[email protected]
with:
max-size: 2G
key: ${{ github.job }}
- name: Build
id: build_extension
run: |
gem install --no-document --user-install nokogiri
export COMMITS_SINCE_LAST_TAG=$(git describe --tags --always --long | awk -F '-' '{print $2}')
EXTENSION_VERSION=$(ruby -e 'print [ARGF.read[/PHP_COUCHBASE_VERSION "(\d+\.\d+\.\d+)"/, 1], ENV["COMMITS_SINCE_LAST_TAG"].to_i > 0 ? ENV["COMMITS_SINCE_LAST_TAG"] : nil].compact.join(".")' src/php_couchbase.hxx)
echo "extension_version=${EXTENSION_VERSION}" >> "$GITHUB_OUTPUT"
export BUILD_NUMBER="${COMMITS_SINCE_LAST_TAG}"
ruby ./bin/package.rb
- name: PHPDoc
run: |
ruby ./bin/docs.rb
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ steps.build_extension.outputs.extension_version }}
path: |
couchbase-*.tgz
- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: scripts-${{ steps.build_extension.outputs.extension_version }}
path: |
bin/**/*
90-couchbase.ini
phpcs.xml
- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: tests-${{ steps.build_extension.outputs.extension_version }}
path: |
tests/**/*
- uses: actions/upload-artifact@v4
with:
name: docs-${{ steps.build_extension.outputs.extension_version }}
path: |
build/couchbase-php-client-*/**/*
build_alpine:
needs: source
name: alpine
runs-on: ubuntu-22.04
container:
image: alpine:3.19
strategy:
fail-fast: false
matrix:
php:
- '81'
- '82'
- '83'
steps:
- name: Install build environment
run: |
apk update
apk add --no-cache \
bash \
build-base \
ccache \
cmake \
curl \
g++ \
gcc \
git \
linux-headers \
make \
ninja-build \
php${{ matrix.php }}-dev \
php${{ matrix.php }}-pear \
openssl \
openssl-dev \
readline-dev \
ruby \
tar \
xz \
yaml-dev \
zlib-dev
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: hendrikmuhs/[email protected]
with:
max-size: 2G
key: ${{ github.job }}-${{ matrix.php }}
- name: Set env variable
run: |
if [ "${{ matrix.version }}" != "unversioned" ]; then
echo "CB_ABI_VERSION=${{ matrix.version }}" >> $GITHUB_ENV
else
echo "Building unversioned extension"
fi
- name: Build
run: |
pecl${{ matrix.php }} bundle couchbase-${{ needs.source.outputs.extension_version }}.tgz
(
cd couchbase
phpize${{ matrix.php }}
./configure --enable-couchbase --with-php-config=$(which php-config${{ matrix.php }})
mkdir target
make INSTALL_ROOT="$(realpath target)" install
)
PHP_VERSION_SHORT=${{ matrix.php }}
PHP_VERSION="${PHP_VERSION_SHORT:0:1}.${PHP_VERSION_SHORT:1}"
echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV
DIST_NAME=couchbase-${{ needs.source.outputs.extension_version }}-php${PHP_VERSION}-nts-linux-musl-x86_64
mkdir ${DIST_NAME}
cp -av couchbase/LICENSE 90-couchbase.ini couchbase/Couchbase couchbase/GPBMetadata ${DIST_NAME}/
find couchbase/target -name couchbase.so -exec cp -v {} ${DIST_NAME}/ \;
strip --strip-all ${DIST_NAME}/couchbase.so
tar cv ${DIST_NAME}/ | gzip -9 > ${DIST_NAME}.tgz
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-nts-linux-musl-x86_64
path: |
couchbase-*-linux-musl-x86_64.tgz
mock_alpine:
needs:
- source
- build_alpine
runs-on: ubuntu-22.04
container:
image: alpine:3.19
strategy:
fail-fast: false
matrix:
php:
- '81'
- '82'
- '83'
steps:
- name: Install test environment
run: |
apk update
apk add --no-cache \
bash \
curl \
git \
php${{ matrix.php }}-dev \
php${{ matrix.php }}-pear \
php${{ matrix.php }}-dom \
php${{ matrix.php }}-intl \
php${{ matrix.php }}-mbstring \
php${{ matrix.php }}-pecl-pcov \
php${{ matrix.php }}-pecl-xdebug \
php${{ matrix.php }}-phar \
php${{ matrix.php }}-sockets \
php${{ matrix.php }}-tokenizer \
php${{ matrix.php }}-xml \
php${{ matrix.php }}-xmlwriter \
openssl \
ruby \
tar \
xz \
yaml-dev \
zlib-dev
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
path: tests
name: tests-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-nts-linux-musl-x86_64
- name: Test
env:
CB_PHP_NAME: php${{ matrix.php }}
run: |
tar xf couchbase-*-linux-musl-x86_64.tgz
ruby ./bin/test.rb
- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
check_name: ⛰️ caves, php-${{ matrix.php }}
report_paths: results.xml
require_tests: true
annotate_only: true
build_linux_x86_64:
needs: source
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
ts:
- nts
- zts
abi:
- default
- locked
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring, intl
env:
phpts: ${{ matrix.ts }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: hendrikmuhs/[email protected]
with:
max-size: 2G
key: ${{ github.job }}-${{ matrix.php }}-${{ matrix.ts }}
- name: Build
run: |
pecl bundle couchbase-${{ needs.source.outputs.extension_version }}.tgz
DIST_ABI=
if [ "${{ matrix.abi }}" = "locked" ]
then
export CB_ABI_VERSION=$(ruby -e 'print ARGF.read[/PHP_COUCHBASE_VERSION "(\d+\.\d+\.\d+)"/, 1].gsub(".", "_")' couchbase/src/php_couchbase.hxx)
DIST_ABI="-abi"
fi
(
cd couchbase
phpize
./configure --enable-couchbase
mkdir target
make INSTALL_ROOT="$(realpath target)" install
)
DIST_NAME=couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-linux-x86_64${DIST_ABI}
mkdir ${DIST_NAME}
cp -av couchbase/LICENSE 90-couchbase.ini couchbase/Couchbase couchbase/GPBMetadata ${DIST_NAME}/
find couchbase/target -name couchbase.so -exec cp -v {} ${DIST_NAME}/ \;
strip --strip-all ${DIST_NAME}/couchbase.so
tar cv ${DIST_NAME}/ | gzip -9 > ${DIST_NAME}.tgz
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-linux-x86_64-${{ matrix.abi }}
path: |
couchbase-*-linux-x86_64*.tgz
mock_linux_x86_64:
needs:
- source
- build_linux_x86_64
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
ts:
- nts
- zts
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring, intl
env:
phpts: ${{ matrix.ts }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
path: tests
name: tests-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-linux-x86_64
- name: Test
run: |
tar xf couchbase-*-linux-x86_64.tgz
ruby ./bin/test.rb
- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
check_name: 🐧caves, php-${{ matrix.php }}-${{ matrix.ts }}
report_paths: results.xml
require_tests: true
annotate_only: true
server_linux_x86_64:
needs:
- source
- build_linux_x86_64
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php:
- '8.3'
ts:
- nts
- zts
server:
- 7.6.3
- 7.2.5
- 7.1.6
- 7.0.5
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring, intl
env:
phpts: ${{ matrix.ts }}
- name: Install cbdinocluster
run: |
mkdir -p "$HOME/bin"
curl -L -o "$HOME/bin/cbdinocluster" https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.52/cbdinocluster-linux-amd64
chmod a+x "$HOME/bin/cbdinocluster"
echo "$HOME/bin" >> $GITHUB_PATH
- name: Initialize cbdinocluster
run: |
cbdinocluster -v init --auto
- name: Start couchbase cluster
env:
CLUSTERCONFIG: |
nodes:
- count: 1
version: ${{ matrix.server }}
services:
- kv
- count: 1
version: ${{ matrix.server }}
services:
- kv
- n1ql
- index
- count: 1
version: ${{ matrix.server }}
services:
- kv
- fts
- cbas
docker:
kv-memory: 1600
run: |
CLUSTER_ID=$(cbdinocluster -v allocate --def="${CLUSTERCONFIG}")
CONNECTION_STRING=$(cbdinocluster -v connstr "${CLUSTER_ID}")
cbdinocluster -v buckets add ${CLUSTER_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=1
cbdinocluster -v buckets load-sample ${CLUSTER_ID} travel-sample
echo "CLUSTER_ID=${CLUSTER_ID}" >> "$GITHUB_ENV"
echo "TEST_CONNECTION_STRING=${CONNECTION_STRING}?dump_configuration=true" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
path: tests
name: tests-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-linux-x86_64
- name: Test
timeout-minutes: 60
env:
TEST_SERVER_VERSION: "${{ matrix.server }}"
TEST_LOG_LEVEL: trace
TEST_BUCKET: default
TEST_USE_WAN_DEVELOPMENT_PROFILE: true
OTHER_TEST_BUCKET: secBucket
run: |
tar xf couchbase-*-linux-x86_64.tgz
ruby ./bin/test.rb
- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
check_name: 🐧server, php-${{ matrix.php }}-${{ matrix.ts }}
report_paths: results.xml
require_tests: true
annotate_only: true
- name: Collect server logs
timeout-minutes: 15
if: failure()
run: |
cbdinocluster -v collect-logs $CLUSTER_ID ./logs
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.server }}-logs
path: |
logs/*
build_macos_x86_64:
needs: source
runs-on: macos-13
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
ts:
- nts
- zts
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# https://github.com/shivammathur/icu-intl#icu4c-builds
extensions: json, mbstring, intl-74.1
env:
phpts: ${{ matrix.ts }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: hendrikmuhs/[email protected]
with:
max-size: 2G
key: ${{ github.job }}-${{ matrix.php }}-${{ matrix.ts }}
- name: Build
run: |
pecl bundle couchbase-${{ needs.source.outputs.extension_version }}.tgz
(
cd couchbase
phpize
./configure --enable-couchbase
mkdir target
make INSTALL_ROOT="$(realpath target)" install
)
DIST_NAME=couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-macos-x86_64
mkdir ${DIST_NAME}
cp -av couchbase/LICENSE 90-couchbase.ini couchbase/Couchbase couchbase/GPBMetadata ${DIST_NAME}/
find couchbase/target -name couchbase.so -exec cp -v {} ${DIST_NAME}/ \;
strip ${DIST_NAME}/couchbase.so 2>/dev/null || true
tar cv ${DIST_NAME}/ | gzip -9 > ${DIST_NAME}.tgz
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-macos-x86_64
path: |
couchbase-*-macos-x86_64.tgz
mock_macos_x86_64:
needs:
- source
- build_macos_x86_64
runs-on: macos-13
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
ts:
- nts
- zts
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# https://github.com/shivammathur/icu-intl#icu4c-builds
extensions: json, mbstring, intl-74.1
env:
phpts: ${{ matrix.ts }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
path: tests
name: tests-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-macos-x86_64
- name: Test
run: |
tar xf couchbase-*-macos-x86_64.tgz
CB_PHP_EXECUTABLE=$(which php) ruby ./bin/test.rb
- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
check_name: 🍏caves, php-${{ matrix.php }}-${{ matrix.ts }}
report_paths: results.xml
require_tests: true
annotate_only: true
build_macos_arm64:
needs: source
runs-on: macos-14
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
ts:
- nts
- zts
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# https://github.com/shivammathur/icu-intl#icu4c-builds
extensions: json, mbstring, intl-74.1
env:
phpts: ${{ matrix.ts }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: hendrikmuhs/[email protected]
with:
max-size: 2G
key: ${{ github.job }}-${{ matrix.php }}-${{ matrix.ts }}
- name: Build
run: |
pecl bundle couchbase-${{ needs.source.outputs.extension_version }}.tgz
(
cd couchbase
phpize
./configure --enable-couchbase
mkdir target
make INSTALL_ROOT="$(realpath target)" install
)
DIST_NAME=couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-macos-arm64
mkdir ${DIST_NAME}
cp -av couchbase/LICENSE 90-couchbase.ini couchbase/Couchbase couchbase/GPBMetadata ${DIST_NAME}/
find couchbase/target -name couchbase.so -exec cp -v {} ${DIST_NAME}/ \;
strip ${DIST_NAME}/couchbase.so 2>/dev/null || true
tar cv ${DIST_NAME}/ | gzip -9 > ${DIST_NAME}.tgz
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-macos-arm64
path: |
couchbase-*-macos-arm64.tgz
mock_macos_arm64:
needs:
- source
- build_macos_arm64
runs-on: macos-14
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
ts:
- nts
- zts
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# https://github.com/shivammathur/icu-intl#icu4c-builds
extensions: json, mbstring, intl-74.1
env:
phpts: ${{ matrix.ts }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
path: tests
name: tests-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-macos-arm64
- name: Test
run: |
tar xf couchbase-*-macos-arm64.tgz
CB_PHP_EXECUTABLE=$(which php) ruby ./bin/test.rb
- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
check_name: 🍎caves, php-${{ matrix.php }}-${{ matrix.ts }}
report_paths: results.xml
require_tests: true
annotate_only: true
build_windows:
needs: source
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
php:
- '8.4.1'
- '8.3.14'
- '8.2.26'
- '8.1.31'
ts:
- nts
- zts
arch:
- x64
- x86
steps:
- name: Install dependencies
shell: cmd
run: |
# winget install Git.Git
# winget install Kitware.CMake
# winget install NASM.NASM
choco install nasm
git clone --no-progress https://github.com/php/php-sdk-binary-tools.git c:\php\php-sdk
git clone --no-progress --depth 1 --branch php-${{ matrix.php }} https://github.com/php/php-src.git c:\php\php-src
- uses: actions/download-artifact@v4
with:
path: c:\php
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
path: c:\php
name: scripts-${{ needs.source.outputs.extension_version }}
- name: Build
working-directory: c:\php
shell: cmd
run: |
7z x couchbase-${{ needs.source.outputs.extension_version }}.tgz -so | 7z x -aoa -si -ttar
cd c:\php\php-src
echo call buildconf.bat --add-modules-dir=c:\php > task.bat
echo call configure.bat --disable-all --enable-cli ${{ matrix.ts == 'nts' && '--disable-zts' || '' }} --enable-couchbase >> task.bat
echo nmake >> task.bat
call c:\php\php-sdk\phpsdk-vs16-${{ matrix.arch }}.bat -t task.bat
exit /b %ERRORLEVEL%
- name: Package
id: package
working-directory: c:\php
run: |
$PhpVersion = ("${{ matrix.php }}" -split '\.')[0..1] -join '.'
Add-Content -Path $env:GITHUB_OUTPUT -Value "php_version=$PhpVersion"
$SourceDirectory = (Get-ChildItem -Path "c:\php" -Directory "couchbase-*" | Select-Object -First 1).FullName
$DistName = "couchbase-${{ needs.source.outputs.extension_version }}-php${PhpVersion}-${{ matrix.ts }}-windows-${{ matrix.arch }}"
New-Item -ItemType Directory -Path $DistName | Out-Null
$FilesToCopy = Get-ChildItem -Path . -Filter "couchbase-*" -Include LICENSE,"Couchbase","GPBMetadata"
Copy-Item -Path 90-couchbase.ini -Destination $DistName -Force
Copy-Item -Path "${SourceDirectory}\LICENSE" -Destination $DistName -Force
Copy-Item -Path "${SourceDirectory}\Couchbase" -Destination $DistName -Force -Recurse
Copy-Item -Path "${SourceDirectory}\GPBMetadata" -Destination $DistName -Force -Recurse
$FilesToCopy = Get-ChildItem -Path "C:\php\php-src\${{ matrix.arch == 'x64' && 'x64\\' || '' }}Release${{ matrix.ts == 'zts' && '_TS' || '' }}" -Filter "php_couchbase.*"
foreach ($File in $FilesToCopy) {
Write-Host "Copying file: $($File.FullName)"
Copy-Item -Path $File.FullName -Destination $DistName -Force
}
$ZipArchive = $DistName + ".zip"
Write-Host "Compressing $DistName directory into $ZipArchive"
Compress-Archive -Path $DistName -DestinationPath $ZipArchive -CompressionLevel Optimal
- uses: actions/upload-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ steps.package.outputs.php_version }}-${{ matrix.ts }}-windows-${{ matrix.arch }}
path: |
c:\php\couchbase-*-windows-${{ matrix.arch }}.zip
mock_windows:
needs:
- source
- build_windows
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
ts:
- nts
- zts
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring, intl, sockets
env:
phpts: ${{ matrix.ts }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: scripts-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
path: tests
name: tests-${{ needs.source.outputs.extension_version }}
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.extension_version }}-php${{ matrix.php }}-${{ matrix.ts }}-windows-x64
- name: Test
timeout-minutes: 60
run: |
Expand-Archive -Path couchbase-*-windows-x64.zip
ruby ./bin/test.rb
- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
check_name: 🪟caves, php-${{ matrix.php }}-${{ matrix.ts }}
report_paths: results.xml
require_tests: true
annotate_only: true