Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pact PHP - Support for V3 / V4 + Plugins Via FFI #326

Merged
merged 508 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
508 commits
Select commit Hold shift + click to select a range
c9f1c3d
test: Use assertJsonStringEqualsJsonString() for better comparing 2 j…
tienvx Dec 18, 2023
8ecdfd7
Merge pull request #372 from tienvx/create-matchers-and-generators-cl…
tienvx Dec 18, 2023
da5aeff
feat: Throw exception when both generator and example value are set
tienvx Dec 18, 2023
df4290c
Merge pull request #420 from tienvx/handle-both-generator-and-example…
tienvx Dec 19, 2023
3587763
feat: Add url matcher
tienvx Dec 19, 2023
c589f89
Merge pull request #421 from tienvx/add-url-matcher
tienvx Dec 19, 2023
eee8305
test(compatibility-suite): Add compatibility suite submodule
tienvx Dec 19, 2023
2947ae4
chore: Remove old composer script
tienvx Dec 19, 2023
180eefc
test(compatibility-suite): Add behat
tienvx Dec 20, 2023
9e8a2f8
test(compatibility-suite): Add SetUpContext
tienvx Dec 20, 2023
a5ea4f3
Merge pull request #425 from tienvx/add-set-up-context
tienvx Dec 20, 2023
2005ae9
Merge pull request #422 from tienvx/add-compatibility-suite-submodule
tienvx Dec 20, 2023
8a61f21
Merge pull request #423 from tienvx/remove-composer-script
tienvx Dec 20, 2023
41d64bd
test(compatibility-suite): Add InteractionBuilder service
tienvx Dec 20, 2023
d60745e
Merge pull request #426 from tienvx/add-interaction-builder-service
tienvx Dec 21, 2023
e287839
test(compatibility-suite): Define interactions
tienvx Dec 21, 2023
ec1452a
Merge pull request #427 from tienvx/define-interactions
tienvx Dec 21, 2023
b8a5234
test(compatibility-suite): Implement V1 Consumer scenarios
tienvx Dec 21, 2023
a6fca91
Merge pull request #428 from tienvx/v1-consumer
tienvx Dec 22, 2023
3b57f20
test(compatibility-suite): Implement V1 Provider scenarios
tienvx Dec 22, 2023
c07b72a
Merge pull request #429 from tienvx/v1-provider
tienvx Dec 22, 2023
6b21ab1
test(compatibility-suite): Implement V2 scenarios
tienvx Dec 22, 2023
556ec04
Merge pull request #430 from tienvx/v2-http-consumer-provider
tienvx Dec 22, 2023
0f69dad
test(compatibility-suite): Implement V3 scenarios
tienvx Dec 23, 2023
cc8135a
test(compatibility-suite): Filter out failed scenarios
tienvx Dec 23, 2023
7a9824e
Merge pull request #431 from tienvx/v3-scenarios
tienvx Dec 24, 2023
3eda898
test(compatibility-suite): Implement V4 scenarios
tienvx Oct 7, 2023
e2f4b70
Merge pull request #432 from tienvx/v4-scenarios
tienvx Dec 24, 2023
19c9938
test(compatibility-suite): Add PactPath DTO
tienvx Dec 24, 2023
f034d33
test(compatibility-suite): Remove PactPath::getProvider() method
tienvx Dec 24, 2023
96b862c
Merge pull request #433 from tienvx/add-pact-path-dto
tienvx Dec 25, 2023
d9b5b47
refactor: Move xml to core
tienvx Dec 26, 2023
9e49b17
Merge pull request #434 from tienvx/move-xml-to-core
tienvx Dec 27, 2023
c95ffcb
chore: Check string generator is working
tienvx Dec 29, 2023
9d2c67d
Merge pull request #435 from tienvx/check-string-generator-is-working
tienvx Dec 30, 2023
a98ca6f
refactor: Move code from matchers to formatters
tienvx Dec 31, 2023
a814a4d
Merge pull request #436 from tienvx/move-code-from-matchers-to-format…
tienvx Dec 31, 2023
05c4c55
refactor!: Re-use existing matchers for xml
tienvx Dec 31, 2023
6c72b4d
Merge pull request #437 from tienvx/reuse-existing-matchers-for-xml
tienvx Jan 1, 2024
e3d0d06
test: Merge xml builder tests
tienvx Jan 1, 2024
72caf79
test: Update xml example
tienvx Jan 1, 2024
07c5cab
Merge pull request #438 from tienvx/merge-xml-builder-tests
tienvx Jan 1, 2024
00ba598
Merge pull request #439 from tienvx/update-xml-example
tienvx Jan 1, 2024
a95c47c
refactor!: Rename class to Plugin\AbstractPluginBodyRegistry
tienvx Jan 7, 2024
5b5bfb4
Merge pull request #441 from tienvx/rename-class
tienvx Jan 7, 2024
be1a80f
refactor!: Move protobuf code to core
tienvx Jan 7, 2024
3de5491
Merge pull request #442 from tienvx/move-protobuf-code-to-core
tienvx Jan 8, 2024
a8d2402
chore: Add protobuf sync message example
tienvx Jan 8, 2024
908b8fe
chore: Suggest install grpc extension for protobuf sync message example
tienvx Jan 13, 2024
90b8461
chore: Revert require-dev's ext-grpc
tienvx Jan 13, 2024
97fdfd8
Merge pull request #444 from tienvx/add-protobuf-sync-message-example
tienvx Jan 13, 2024
b5caced
ci(test): Compile grpc and cache docker image on Cirrus CI
tienvx Jan 13, 2024
af27c18
refactor!: Move csv to core
tienvx Jan 1, 2024
95ed5ab
chore: Add protobuf async message example
tienvx Jan 8, 2024
7c39e62
Merge pull request #440 from tienvx/move-csv-to-core
tienvx Jan 14, 2024
ddf67b3
Merge pull request #445 from tienvx/compile-grpc-and-cache-docker-image
tienvx Jan 16, 2024
12120e2
refactor: Add PluginFormatter
tienvx Jan 16, 2024
cb83c2e
deps: Update ffi library to 0.4.13
tienvx Jan 17, 2024
d08322d
test(compatibility-suite): Fix error 'Matching rule JSON [] is not co…
tienvx Jan 19, 2024
9b3e8c9
Merge pull request #443 from tienvx/add-protobuf-async-message-example
tienvx Jan 23, 2024
61b4f69
Merge pull request #448 from tienvx/plugin-formatter
tienvx Jan 23, 2024
8d3f617
Merge pull request #449 from tienvx/update-ffi-library
tienvx Jan 23, 2024
59154e1
ci: Reduce test running time by setting PACT_DO_NOT_TRACK
tienvx Jan 23, 2024
b7ba915
Merge pull request #450 from tienvx/reduce-test-running-time
tienvx Jan 23, 2024
ecbc3bf
chore: Reuse process handling code
tienvx Jan 23, 2024
fc68c56
chore: Update remaining pacts for 0.4.13
tienvx Jan 24, 2024
15e53e1
Merge pull request #453 from tienvx/update-remaining-pacts
tienvx Jan 24, 2024
6933622
Merge pull request #451 from tienvx/reuse-process
tienvx Jan 24, 2024
464c577
feat: Allow turn off log
tienvx Jan 25, 2024
afcecb9
Merge pull request #454 from tienvx/allow-turn-off-log
tienvx Jan 26, 2024
555368c
chore(ci): remove cirrus-ci
YOU54F Jan 31, 2024
9306249
Merge pull request #456 from pact-foundation/chore/ci_rm_cirrus_ffi
YOU54F Feb 1, 2024
343c91b
ci(test): Test mac arm
tienvx Feb 5, 2024
15b0000
Merge pull request #457 from tienvx/test-mac-arm
tienvx Feb 5, 2024
f2eba2a
chore: Remove unnecessary return
tienvx Feb 5, 2024
767e955
chore: Throw CDataNotCreatedException
tienvx Feb 5, 2024
ae9d81f
chore: Add FFIException
tienvx Feb 5, 2024
4c06cde
chore: Deprecate Values matcher
tienvx Feb 6, 2024
60800ce
ci: Remove remaining Dockerfile for cirrus ci
tienvx Feb 6, 2024
20571b3
Merge pull request #462 from tienvx/remove-docker-file
tienvx Feb 6, 2024
02a320c
Merge pull request #460 from tienvx/add-ffi-exception
tienvx Feb 6, 2024
55fe122
Merge pull request #461 from tienvx/deprecate-values-matcher
tienvx Feb 6, 2024
0dcee74
Merge pull request #458 from tienvx/remove-unnecessary-return
tienvx Feb 6, 2024
a8949c8
Merge pull request #459 from tienvx/throw-cdata-not-created-exception
tienvx Feb 7, 2024
a33dc12
chore: add example for header matchers
tienvx Oct 23, 2023
30d4b6f
chore: No need manually json encode matcher
tienvx Feb 9, 2024
dda2989
Merge pull request #465 from tienvx/add-header-matcher-examples
tienvx Feb 10, 2024
7f634f1
Merge pull request #466 from tienvx/simplify-query-matcher-examples
tienvx Feb 10, 2024
7faaf8b
deps: Upgrade PHP to 8.3 and drop 8.0
tienvx Feb 7, 2024
882057c
Merge pull request #468 from tienvx/upgrade-php
tienvx Feb 13, 2024
2df6798
deps: Upgrade phpunit
tienvx Feb 14, 2024
89f8927
test: Fix deprecations 'Data Provider method is not static'
tienvx Feb 14, 2024
a3f77bf
test: Fix PHPUnit XML deprecated schema
tienvx Feb 14, 2024
d35a848
chore: Ignore phpunit cache
tienvx Feb 14, 2024
95d374b
ci: Enable code coverage now required by phpunit
tienvx Feb 14, 2024
913e051
ci: Fix phpunit error 'Unknown option --debug'
tienvx Feb 14, 2024
d12af02
ci: Remove phpunit composer's script
tienvx Feb 15, 2024
8790877
Revert "ci: Remove phpunit composer's script"
tienvx Feb 15, 2024
01ad468
fix: Remove coverage
tienvx Feb 15, 2024
18147b6
fix: Remove debug
tienvx Feb 15, 2024
49f9c5d
fix: Fix 'Element source not expected'
tienvx Feb 15, 2024
aa6f0a6
deps: Upgrade PHPUnit to lowest 10.1
tienvx Feb 15, 2024
94ad033
deps: Revert PHPUnit 9
tienvx Feb 15, 2024
a7b4afa
Merge pull request #471 from tienvx/upgrade-phpunit
tienvx Feb 15, 2024
24f5720
deps: Update spiral/roadrunner-grpc
tienvx Feb 15, 2024
567b799
deps: Update roadrunner binary
tienvx Feb 15, 2024
b3894a1
chore: Update plugin versions in pacts
tienvx Feb 15, 2024
ddba84d
chore: Use PHP 8.1 feature: Unpack string-keyed arrays
tienvx Feb 15, 2024
e572d7a
Merge pull request #473 from tienvx/update-roadrunner-grpc
tienvx Feb 16, 2024
f7a882f
Merge pull request #474 from tienvx/update-roadrunner
tienvx Feb 16, 2024
f9b9e60
Merge pull request #475 from tienvx/update-plugin-versions-in-pacts
tienvx Feb 16, 2024
20bfb87
Merge pull request #476 from tienvx/unpack-array-with-string-keys
tienvx Feb 16, 2024
3c8466e
feat: Add Selector class
tienvx Feb 16, 2024
6f53685
chore: Remove unused exception ConnectionException
tienvx Feb 16, 2024
ec011e4
deps: Require ffi extension
tienvx Feb 16, 2024
69dfc0a
deps: Update ffi library to 0.4.16
tienvx Feb 16, 2024
d4ad1a0
fix: FFI > Create managed binary data
tienvx Feb 16, 2024
0ab3a0a
Merge pull request #481 from tienvx/create-managed-binary-data
tienvx Feb 17, 2024
9209793
Merge pull request #480 from tienvx/update-ffi-library
tienvx Feb 17, 2024
6b7aa6c
Merge pull request #479 from tienvx/require-ffi-extension
tienvx Feb 17, 2024
d02f490
Merge pull request #477 from tienvx/add-selector-class
tienvx Feb 17, 2024
f8f82b8
Merge pull request #478 from tienvx/remove-unused-exception
tienvx Feb 17, 2024
4073642
refactor: Move description to trait
tienvx Feb 19, 2024
9a8a939
refactor: Add InteractionPart enum
tienvx Feb 19, 2024
339328b
Merge pull request #482 from tienvx/description-trait
tienvx Feb 20, 2024
d1560fa
refactor: Add id trait
tienvx Feb 19, 2024
252562c
refactor: Rename (interaction) id to handle
tienvx Feb 20, 2024
ef8ddfc
ci(compatibility-suite): Use wip tag
tienvx Feb 20, 2024
b726938
Merge pull request #485 from tienvx/id-trait
tienvx Feb 21, 2024
c8e3714
Merge branch 'ffi' into interaction-part-enum
tienvx Feb 21, 2024
7dab4a9
refactor: Add Interaction::getBody() and Interaction::getHeaders() me…
tienvx Feb 21, 2024
c0bc9a1
Merge pull request #486 from tienvx/update-compatibility-suite
tienvx Feb 21, 2024
77cd36d
ci: Tune network
tienvx Feb 22, 2024
47bdd51
ci: Run command from the action directly
tienvx Feb 23, 2024
af0e06e
Merge pull request #488 from tienvx/tune-network
tienvx Feb 23, 2024
953e4e6
Merge pull request #483 from tienvx/interaction-part-enum
tienvx Feb 24, 2024
d1e9c63
refactor: Add body drivers
tienvx Feb 19, 2024
5585069
Merge pull request #489 from tienvx/body-drivers
tienvx Feb 24, 2024
5952c78
refactor: Add interaction part drivers
tienvx Feb 20, 2024
0b15197
fix: Fix error 'Cannot use object of type FFI\CData as array'
tienvx Feb 25, 2024
a6d4eb1
Merge pull request #491 from tienvx/fix-check-isset-cdata
tienvx Feb 25, 2024
5d300ed
Merge pull request #490 from tienvx/interaction-part-drivers
tienvx Feb 25, 2024
152eceb
refactor: Remove $this return value
tienvx Feb 25, 2024
bcee663
Merge pull request #492 from tienvx/remove-this
tienvx Feb 26, 2024
e876d5e
refactor: Merge PactDriver and PactRegistry
tienvx Feb 27, 2024
0795996
Merge pull request #494 from tienvx/refactor-pact-driver
tienvx Feb 29, 2024
2ad9974
refactor: Merge InteractionRegistry and InteractionDriver
tienvx Feb 28, 2024
fae219a
Revert "ci: Tune network"
tienvx Feb 29, 2024
1c45cad
refactor: Merge MessageRegistry and MessageDriver
tienvx Feb 28, 2024
7a45593
refactor: Merge SyncMessageRegistry and SyncMessageDriver
tienvx Feb 29, 2024
2da6624
test: Test mock server
tienvx Feb 29, 2024
08109bf
ci: Split jobs
tienvx Feb 29, 2024
d156238
ci: Allow 'composer test' to take extra options
tienvx Feb 29, 2024
7e96006
Merge pull request #497 from tienvx/split-ci-jobs
tienvx Mar 1, 2024
34f3cfc
Merge pull request #496 from tienvx/refactor-interaction-driver
tienvx Mar 1, 2024
26884c4
ci(compatibility-suite): Force output colors for behat
tienvx Mar 1, 2024
182cd03
ci(compatibility-suite): Update Github Actions
tienvx Mar 1, 2024
7e95c93
feat: Allow set interaction key for v4
tienvx Feb 29, 2024
9c9b13e
feat: Allow mark interaction as pending for v4
tienvx Mar 1, 2024
6366b40
feat: Allow set comments for interaction in v4
tienvx Mar 1, 2024
b04a801
Merge pull request #499 from tienvx/refactor-message-driver
tienvx Mar 2, 2024
d24edd6
Merge pull request #498 from tienvx/test-mock-server
tienvx Mar 2, 2024
d265682
Merge pull request #500 from tienvx/behat-force-colors
tienvx Mar 2, 2024
f29d2fc
Merge pull request #501 from tienvx/update-github-actions
tienvx Mar 2, 2024
bfd963d
Merge pull request #502 from tienvx/refactor-sync-message-driver
tienvx Mar 2, 2024
6b18f08
Merge pull request #503 from tienvx/v4-interaction-key
tienvx Mar 2, 2024
ebceab1
Merge pull request #504 from tienvx/v4-pending-state
tienvx Mar 2, 2024
8a92710
ci: Cache pact plugins
tienvx Feb 22, 2024
c30911d
ci: Update composer install action to avoid deprecation notices
tienvx Mar 3, 2024
dac63e1
Merge pull request #505 from tienvx/v4-comments
tienvx Mar 3, 2024
9d7ad93
Merge pull request #506 from tienvx/update-github-action
tienvx Mar 3, 2024
76878c1
Merge pull request #507 from tienvx/cache-pact-plugins
tienvx Mar 3, 2024
07029ba
ci: Update PHP to 8.3 for MacOS 12
tienvx Mar 3, 2024
6d58cf2
fix: Fix unknown specification not working
tienvx Mar 4, 2024
4815979
Merge pull request #509 from tienvx/update-php-macos-12
tienvx Mar 5, 2024
ea5b939
Merge pull request #511 from tienvx/fix-unknown-specification
tienvx Mar 5, 2024
64a699d
test(compatibility-suite): Fix compatibility suite v1 hang
tienvx Feb 6, 2024
72494b5
Merge pull request #463 from tienvx/fix-compatibility-suite-v1-hang
tienvx Mar 5, 2024
62d40f0
feat: Allow sending csv body in request
tienvx Feb 26, 2024
7476d67
test: Move reusable test method into trait
tienvx Mar 5, 2024
0ac6e12
feat: Allow to build multiple interactions
tienvx Feb 26, 2024
d7d2588
ci(compatibility-suite): Use default PHP for ubuntu-latest (8.1)
tienvx Mar 5, 2024
1d5d1c1
Revert "test(compatibility-suite): Fix compatibility suite v1 hang"
YOU54F Mar 5, 2024
483441b
Merge pull request #514 from pact-foundation/revert-463-fix-compatibi…
tienvx Mar 5, 2024
118d958
Merge pull request #513 from tienvx/use-default-php
tienvx Mar 6, 2024
0d11854
Merge pull request #508 from tienvx/multiple-interactions
tienvx Mar 6, 2024
0ae50ce
Merge pull request #510 from tienvx/csv-request
tienvx Mar 6, 2024
df46362
test: Test remaining factories
tienvx Mar 6, 2024
a63d563
Merge pull request #515 from tienvx/test-factories
tienvx Mar 6, 2024
d2c8f80
test: Test Verifier
tienvx Mar 6, 2024
7dad9bb
Merge pull request #516 from tienvx/test-verifier
tienvx Mar 7, 2024
5cae96e
test: Test MessageBuilder
tienvx Mar 7, 2024
b249af0
test: Test SyncMessageBuilder
tienvx Mar 7, 2024
2778c3c
test: Test MockServerConfig::getBaseUri()
tienvx Mar 7, 2024
1318de8
test: Test MockServerEnvConfig
tienvx Mar 7, 2024
08ac678
test: Test more cases for PactConfig::setLogLevel()
tienvx Mar 7, 2024
90a0780
test: Test stub server
tienvx Mar 7, 2024
b3067b8
revert: Set up pact on demand to speed up factory's unit tests
tienvx Mar 8, 2024
abd8505
test: Preserve env while testing MockServerEnvConfig
tienvx Mar 8, 2024
e9675ee
refactor: Remove file_exists checking
tienvx Mar 8, 2024
32574df
Merge pull request #518 from tienvx/test-message-builder
tienvx Mar 8, 2024
6e5009a
Merge pull request #519 from tienvx/test-sync-message-builder
tienvx Mar 8, 2024
31d545f
Merge pull request #520 from tienvx/test-get-base-uri
tienvx Mar 8, 2024
728798c
Merge pull request #521 from tienvx/test-mock-server-env-config
tienvx Mar 8, 2024
e630a2d
Merge pull request #522 from tienvx/test-set-log-level-more-cases
tienvx Mar 8, 2024
cac3ff4
Merge pull request #523 from tienvx/test-stub-server
tienvx Mar 8, 2024
c1322ed
Merge pull request #524 from tienvx/setup-pact-on-demand
tienvx Mar 8, 2024
5ee841e
Merge pull request #525 from tienvx/remove-file-exists-checking
tienvx Mar 8, 2024
5099734
test: Test body models
tienvx Mar 8, 2024
eb1abfb
test: Test ArrayData::createFrom() with empty array
tienvx Mar 8, 2024
74a2d33
test: Test FFI Client
tienvx Mar 8, 2024
a2c67bb
test: Test xml's mixed content
tienvx Mar 8, 2024
cf213a9
chore: Remove unused exception PactNotRegisteredException
tienvx Mar 8, 2024
c3488b2
test: Test add/set provider state for interaction/message
tienvx Mar 8, 2024
6f31f4b
test: Test VerifierConfig
tienvx Mar 8, 2024
079100b
refactor: Update exception's parent
tienvx Mar 8, 2024
6109d1d
Merge pull request #526 from tienvx/test-body-models
tienvx Mar 9, 2024
47c37db
Merge pull request #530 from tienvx/test-xml-mixed-content
tienvx Mar 9, 2024
772554b
Merge pull request #532 from tienvx/test-add-provider-state
tienvx Mar 9, 2024
bf0fd07
Merge pull request #533 from tienvx/test-verifier-config
tienvx Mar 9, 2024
3cf76c0
test: Test body for interaction/message
tienvx Mar 8, 2024
d41f016
Merge pull request #534 from tienvx/test-body-for-interaction-message
tienvx Mar 9, 2024
8e5a3c5
test: Change ffi method to test. Assert result
tienvx Mar 9, 2024
175aaf0
Merge pull request #528 from tienvx/test-ffi-client
tienvx Mar 9, 2024
75d2967
refactor(test): Reuse ClientTrait
tienvx Mar 9, 2024
c26401e
Merge pull request #536 from tienvx/reuse-client-trait
tienvx Mar 9, 2024
4f0685c
test: Test GrpcMockServer
tienvx Mar 8, 2024
88d582f
Merge pull request #529 from tienvx/test-grpc-mock-server
tienvx Mar 9, 2024
9e715df
test: Test verifier with empty array config
tienvx Mar 9, 2024
28ca8e7
Merge branch 'test-array-data-create-from-empty-array' into test-empt…
tienvx Mar 9, 2024
2e510a5
deps: Upgrade symfony/process
tienvx Mar 10, 2024
ad0cdbf
deps: Remove slim/psr7
tienvx Mar 10, 2024
3086414
Merge pull request #539 from tienvx/upgrade-symfony-process
tienvx Mar 11, 2024
40b9143
Merge pull request #538 from tienvx/clean-up-psr7
tienvx Mar 11, 2024
3836547
Merge pull request #531 from tienvx/remove-unused-exception
tienvx Mar 13, 2024
39c9992
refactor: Rename PactFileNotWroteException to PactFileNotWrittenExcep…
tienvx Mar 13, 2024
4d549da
refactor: Rename MockServerNotWrotePactFileException to MockServerPac…
tienvx Mar 13, 2024
f22d068
Merge pull request #535 from tienvx/update-exception-parent
tienvx Mar 13, 2024
f5f5d0a
Merge pull request #537 from tienvx/test-empty-array
tienvx Mar 13, 2024
00d457f
Merge branch 'master' into merge-master
tienvx Mar 13, 2024
1e4158f
Merge pull request #540 from tienvx/merge-master
tienvx Mar 13, 2024
912be97
Merge branch 'master' into ffi
tienvx Mar 13, 2024
dd7c340
deps: Require ext-openssl
tienvx Mar 14, 2024
1c98862
fix: Swap implementation of setFilterInfo() and setProviderState()
tienvx Mar 14, 2024
ec733b0
Merge pull request #542 from tienvx/swap-methods
tienvx Mar 14, 2024
11856c2
Merge pull request #541 from tienvx/require-openssl
tienvx Mar 15, 2024
cc1cb75
chore: Keep start-provider script but return error
tienvx Mar 15, 2024
f782ba2
Merge pull request #543 from tienvx/add-start-provider-script-back
tienvx Mar 16, 2024
dba67dd
deps: Use pact-foundation/composer-downloads-plugin
tienvx Mar 26, 2024
d3eea2a
Merge pull request #544 from tienvx/replace-composer-downloads-plugin
tienvx Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
116 changes: 102 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pact-php
name: Code Analysis & Test

on:
push:
push:
pull_request:
# Once on the first of the month at 06:00 UTC
schedule:
Expand All @@ -16,8 +16,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.2' ]

steps:
- uses: actions/checkout@v4
Expand All @@ -26,7 +24,8 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
php-version: 8.1
coverage: none

- uses: ramsey/composer-install@v3
with:
Expand All @@ -38,18 +37,104 @@ jobs:
- name: Static Code Analysis
run: composer run static-code-analysis

test:
runs-on: ${{ matrix.operating-system }}
examples:
runs-on: ${{ matrix.os }}
needs:
- php-cs
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, macos-latest, windows-latest ]
php: [ '8.0', '8.1', '8.2' ]
dependencies: [ 'lowest', 'locked' ]
include:
- os: ubuntu-latest
php: 8.1
- os: macos-12
php: 8.3
- os: macos-14
php: 8.2
- os: windows-latest
example: 'json'
php: 8.2
- os: windows-latest
example: 'binary'
php: 8.2
- os: windows-latest
example: 'multipart'
php: 8.2
- os: windows-latest
example: 'xml'
php: 8.2
- os: windows-latest
example: 'message'
php: 8.2
- os: windows-latest
example: 'matchers'
php: 8.2
- os: windows-latest
example: 'generators'
php: 8.2
- os: windows-latest
example: 'csv'
php: 8.2
- os: windows-latest
example: 'protobuf-sync-message'
php: 8.1
- os: windows-latest
example: 'protobuf-async-message'
php: 8.2
- os: windows-latest
example: 'stub-server'
php: 8.2
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
name: Checkout repository

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
extensions: sockets, curl, zip, ffi ${{ (!matrix.example || matrix.example == 'protobuf-sync-message') && ', grpc' || '' }}
php-version: ${{ matrix.php }}
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Composer install
uses: ramsey/composer-install@v3
with:
dependency-versions: 'locked'

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ !matrix.example || contains(matrix.example, 'protobuf') }}

- name: Generate Library
run: composer gen-lib
if: ${{ !matrix.example || contains(matrix.example, 'protobuf') }}

- name: Cache Pact Plugins
uses: actions/cache@v4
with:
path: ~/.pact/plugins
key: ${{ matrix.os }}-pact-plugins
if: ${{ !matrix.example || matrix.example == 'csv' || contains(matrix.example, 'protobuf') }}

- name: Run example(s)
run: composer test -- --exclude-testsuite unit ${{ matrix.example && format('--testsuite {0}-example', matrix.example) || '' }}
env:
PACT_DO_NOT_TRACK: true

name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies
unit:
runs-on: ubuntu-latest
needs:
- php-cs
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3' ]
dependencies: [ 'lowest', 'locked' ]

steps:
- uses: actions/checkout@v4
Expand All @@ -58,13 +143,16 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
extensions: openssl, sockets, curl, zip
extensions: 'sockets, curl, zip, ffi'
php-version: ${{ matrix.php }}
coverage: pcov

- name: Composer install
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Composer test
run: composer test
- name: Test Unit
run: vendor/bin/phpunit --testsuite unit
env:
PACT_DO_NOT_TRACK: true
72 changes: 72 additions & 0 deletions .github/workflows/compatibility-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Compatibility Suite

on: [push, pull_request]

env:
PACT_DO_NOT_TRACK: true

jobs:
v1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- uses: ramsey/composer-install@v3

- name: Run Behat
run: vendor/bin/behat compatibility-suite/pact-compatibility-suite/features/V1 --colors
v2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- uses: ramsey/composer-install@v3

- name: Run Behat
run: vendor/bin/behat compatibility-suite/pact-compatibility-suite/features/V2 --colors
v3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- uses: ramsey/composer-install@v3

- name: Run Behat
run: vendor/bin/behat compatibility-suite/pact-compatibility-suite/features/V3 --name '/^((?!binary body \(negative|Message provider).)*$/' --colors
v4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- uses: ramsey/composer-install@v3

- name: Run Behat
run: vendor/bin/behat compatibility-suite/pact-compatibility-suite/features/V4 --colors
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,4 @@ vendor/*
test_results
pact
example/output/*
.phpunit.cache/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "compatibility-suite/pact-compatibility-suite"]
path = compatibility-suite/pact-compatibility-suite
url = https://github.com/pact-foundation/pact-compatibility-suite.git
5 changes: 4 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->in(__DIR__ . '/example')
->in(__DIR__ . '/compatibility-suite/tests')
->exclude('library/src')
->name('*.php');

$config = new PhpCsFixer\Config();
$config->setRules(['@PSR12' => true,
$config->setRules([
'@PSR12' => true,
'strict_param' => false,
'array_syntax' => ['syntax' => 'short'],
])
Expand Down
57 changes: 57 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Pact-PHP

## Pre Reqs

- PHP 8.x or greater
- FFI and Sockets extensions enabled in your php.ini

## Steps

1. Run `composer install`
1. This will install php dependencies to `vendor`
2. This will install pact libraries to `bin`
2. Run `composer test`
1. This will run our unit tests
3. Run `composer lint`
1. This will run the phpcs-lint
4. Run `composer fix`
1. This will correct any auto fixable linter errors
5. Run `composer static-code-analysis`
1. Run static code analysis

## CI Locally

### MacOS ARM

#### Pre Reqs

- MacOS ARM
- Tart.run
- Cirrus-CLI

#### Steps

Run all versions of PHP

- `cirrus run --output github-actions macos_arm64 -e CIRRUS_CLI=true`

Run a specified version of PHP

- `cirrus run --output github-actions 'macos_arm64 VERSION:8.2' -e CIRRUS_CLI=true`

### Linux ARM

#### Pre Reqs

- Docker
- x86_64 or arm64/aarch64 host

#### Steps

Run all versions of PHP

- `cirrus run --output github-actions linux_arm64`

Run a specified version of PHP

- `cirrus run --output github-actions 'macos_arm64 VERSION:8.2'`
Loading