Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1' ]
php: [ '8.0', '8.1' ]

steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
- uses: actions/checkout@v3
name: Checkout repository

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- uses: ramsey/composer-install@v1
- uses: ramsey/composer-install@v2
with:
dependency-versions: 'locked'

Expand All @@ -47,30 +47,27 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, macos-latest, windows-latest ]
php: [ '7.4', '8.0', '8.1' ]
php: [ '8.0', '8.1', '8.2' ]
dependencies: [ 'lowest', 'locked' ]

name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies

steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
name: Checkout repository

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
extensions: openssl, sockets, curl, zip
php-version: ${{ matrix.php }}

- name: Copy the inis
if: runner.os == 'Windows'
run: Copy-Item -Path .\tests\PhpPact\php.ini -Destination C:\tools\php\ -Force

- name: Composer install
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: ${{ matrix.composer-options }}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Table of contents
* [Examples](#additional-examples)

## Versions
9.X updates internal dependencies and libraries. This results in dropping PHP 7.4

8.X updates internal dependencies and libraries. This results in dropping PHP 7.3

7.x updates internal dependencies and libraries, mostly to Guzzle 7.X. This results in dropping support for PHP 7.2.
Expand Down
27 changes: 22 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": "^7.4|^8.0|^8.1",
"php": "^8.0",
"ext-openssl": "*",
"ext-json": "*",
"composer/semver": "^1.4.0|^3.2.0",
Expand All @@ -35,7 +35,8 @@
"amphp/cache": "^1.4.0",
"amphp/windows-registry": "v0.3.3",
"guzzlehttp/guzzle": "^6.5.8|^7.4.5",
"phpunit/phpunit": ">=8.5.23"
"phpunit/phpunit": ">=8.5.23",
"tienvx/composer-downloads-plugin": "^1.1.0"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
Expand Down Expand Up @@ -69,13 +70,29 @@
}
},
"scripts": {
"post-update-cmd": [
"\\PhpPact\\Standalone\\Installer\\InstallManager::uninstall"
],
"start-provider": "php -S localhost:58000 -t example/src/Provider/public/",
"static-code-analysis": "phpstan analyse src/ --level=5",
"lint": "php-cs-fixer fix --config .php-cs-fixer.php --dry-run",
"fix": "php-cs-fixer fix --config .php-cs-fixer.php",
"test": "phpunit --debug -c example/phpunit.all.xml"
},
"extra": {
"downloads": {
"pact-ruby-standalone": {
"version": "1.91.0",
"variables": {
"{$os}": "PHP_OS_FAMILY === 'Windows' ? 'win32' : (PHP_OS === 'Darwin' ? 'osx' : 'linux')",
"{$architecture}": "PHP_OS === 'Linux' ? '-x86_64' : ''",
"{$extension}": "PHP_OS_FAMILY === 'Windows' ? 'zip' : 'tar.gz'"
},
"url": "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v{$version}/pact-{$version}-{$os}{$architecture}.{$extension}",
"path": "bin/pact-ruby-standalone"
}
}
},
"config": {
"allow-plugins": {
"tienvx/composer-downloads-plugin": true
}
Comment on lines +93 to +96
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this config to make running test easier. I think each project depend on this library also need to define this config again in composer.json

Copy link
Contributor Author

@tienvx tienvx Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update README.md and/or CHANGELOG.md and/or UPGRADE-9.0.md about this change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we can provide support for a user to support the ffi being provided by them in their own location (which should be fine as we can have to provide a path to the library loader) we can support users who dont want to, or cant enable scripts to download.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with it.

This feature can be useful for plugins. See this link for explanation.

Currently I don't have any idea on how to do it. Can you create a ticket so we can look at it later?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course buddy 👍🏾 shall do now

}
}
5 changes: 0 additions & 5 deletions example/tests/Provider/PactVerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Provider;

use GuzzleHttp\Psr7\Uri;
use PhpPact\Standalone\Installer\Exception\FileDownloadFailureException;
use PhpPact\Standalone\Installer\Exception\NoDownloaderFoundException;
use PhpPact\Standalone\ProviderVerifier\Model\VerifierConfig;
use PhpPact\Standalone\ProviderVerifier\Verifier;
use PhpPact\Standalone\Runner\ProcessRunner;
Expand Down Expand Up @@ -41,9 +39,6 @@ protected function tearDown(): void

/**
* This test will run after the web server is started.
*
* @throws FileDownloadFailureException
* @throws NoDownloaderFoundException
*/
public function testPactVerifyConsumer()
{
Expand Down
31 changes: 0 additions & 31 deletions script/create-pr-to-update-pact-ruby-standalone.sh

This file was deleted.

6 changes: 0 additions & 6 deletions src/PhpPact/Consumer/MessageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ public function withContent($contents): self
/**
* Run reify to create an example pact from the message (i.e. create messages from matchers)
*
* @throws \PhpPact\Standalone\Installer\Exception\FileDownloadFailureException
* @throws \PhpPact\Standalone\Installer\Exception\NoDownloaderFoundException
*
* @return string
*/
public function reify(): string
Expand Down Expand Up @@ -169,9 +166,6 @@ public function verify($description = false): bool
/**
* Write the Pact without deleting the interactions.
*
* @throws \PhpPact\Standalone\Installer\Exception\FileDownloadFailureException
* @throws \PhpPact\Standalone\Installer\Exception\NoDownloaderFoundException
*
* @return bool
*/
public function writePact(): bool
Expand Down
4 changes: 2 additions & 2 deletions src/PhpPact/Provider/MessageVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Amp\Socket;
use GuzzleHttp\Psr7\Uri;
use Monolog\Logger;
use PhpPact\Standalone\Installer\Model\Scripts;
use PhpPact\Standalone\ProviderVerifier\Model\VerifierConfigInterface;
use PhpPact\Standalone\ProviderVerifier\Verifier;

Expand Down Expand Up @@ -150,8 +151,7 @@ protected function verifyAction(array $arguments)
$callbacks = $this->callbacks;
$uri = $this->config->getProviderBaseUrl();

$scripts = $this->installManager->install();
$arguments = \array_merge([$scripts->getProviderVerifier()], $arguments);
$arguments = \array_merge([Scripts::getProviderVerifier()], $arguments);

/**
* @throws \Amp\Socket\SocketException
Expand Down
4 changes: 2 additions & 2 deletions src/PhpPact/Standalone/Broker/Broker.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Amp\Log\ConsoleFormatter;
use Amp\Log\StreamHandler;
use Monolog\Logger;
use PhpPact\Standalone\Installer\InstallManager;
use PhpPact\Standalone\Installer\Model\Scripts;
use PhpPact\Standalone\Runner\ProcessRunner;

class Broker
Expand All @@ -21,7 +21,7 @@ class Broker
public function __construct(BrokerConfig $config)
{
$this->config = $config;
$this->command = (new InstallManager())->install()->getBroker();
$this->command = Scripts::getBroker();
$this->logger = (new Logger('console'))
->pushHandler(
(new StreamHandler(new ResourceOutputStream(\STDOUT)))
Expand Down

This file was deleted.

This file was deleted.

Loading