-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
277 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[*.yml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
roave-bc-check: | ||
name: Roave BC Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Roave BC Check | ||
uses: "docker://nyholm/roave-bc-check-ga" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
latest: | ||
name: PHP ${{ matrix.php }} Latest | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['7.1', '7.2', '7.3', '7.4', '8.0'] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Install PHP 7 dependencies | ||
run: composer update --prefer-dist --no-interaction --no-progress | ||
if: "startsWith(matrix.php, '7.')" | ||
|
||
- name: Install PHP 8 dependencies | ||
run: | | ||
composer require "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update | ||
composer update --prefer-dist --prefer-stable --no-interaction --no-progress --ignore-platform-req=php | ||
if: "startsWith(matrix.php, '8.')" | ||
|
||
- name: Execute tests | ||
run: composer test | ||
|
||
lowest: | ||
name: PHP ${{ matrix.php }} Lowest | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['7.1', '7.4'] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v1 | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: | | ||
wget https://github.com/puli/cli/releases/download/1.0.0-beta9/puli.phar && chmod +x puli.phar | ||
composer require "sebastian/comparator:^3.0.2" "puli/composer-plugin:1.0.0-beta9" --no-interaction --no-update | ||
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress | ||
- name: Execute tests | ||
run: composer test | ||
|
||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2 | ||
coverage: xdebug | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update | ||
composer update --prefer-dist --no-interaction --no-progress | ||
- name: Execute tests | ||
run: composer test-ci | ||
|
||
- name: Upload coverage | ||
run: | | ||
wget https://scrutinizer-ci.com/ocular.phar | ||
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Installation | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
installation: | ||
name: Installation test ${{ matrix.expect }} ${{ matrix.method }} ${{ matrix.requirements }} ${{ matrix.pecl }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
# Test that we find Guzzle 6 v1 | ||
- expect: will-find | ||
requirements: "php-http/guzzle6-adapter:^1.1.1" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
# Test that we find Guzzle 6 v2 | ||
- expect: will-find | ||
requirements: "php-http/guzzle6-adapter:^2.0.1" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
# Test that we find Guzzle 7 Adapter | ||
- expect: will-find | ||
requirements: "php-http/guzzle7-adapter:^0.1" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
# Test that we find a client with Symfony and Guzzle PSR-7 | ||
- expect: will-find | ||
requirements: "symfony/http-client:^5 php-http/httplug php-http/message-factory guzzlehttp/psr7:^1 http-interop/http-factory-guzzle" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
# We should fail if we dont have php-http/message-factory or PSR-17 | ||
- expect: cant-find | ||
requirements: "symfony/http-client:^5 php-http/httplug php-http/message-factory guzzlehttp/psr7:^1" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
- expect: cant-find | ||
requirements: "symfony/http-client:^5 php-http/httplug guzzlehttp/psr7:^1 http-interop/http-factory-guzzle" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
# We should be able to find a client when Symfony is only partly installed and we have guzzle adapter installed | ||
- expect: will-find | ||
requirements: "symfony/http-client:^5 php-http/guzzle6-adapter php-http/httplug php-http/message-factory guzzlehttp/psr7:^1" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
# Test that we find a client with Symfony and Guzzle | ||
- expect: will-find | ||
requirements: "php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter" | ||
method: "Http\\Discovery\\HttpClientDiscovery::find();" | ||
# Test that we find an async client with Symfony and Guzzle | ||
- expect: will-find | ||
requirements: "php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter" | ||
method: "Http\\Discovery\\HttpAsyncClientDiscovery::find();" | ||
# Test that we find PSR-18 Guzzle 6 | ||
- expect: will-find | ||
requirements: "php-http/guzzle6-adapter:^2.0.1" | ||
method: "Http\\Discovery\\Psr18ClientDiscovery::find();" | ||
# Test that we find PSR-18 Guzzle 7 | ||
- expect: will-find | ||
requirements: "guzzlehttp/guzzle:^7.0.1" | ||
method: "Http\\Discovery\\Psr18ClientDiscovery::find();" | ||
# Test that we find PSR-18 Symfony 4 | ||
- expect: will-find | ||
requirements: "symfony/http-client:^4 php-http/httplug nyholm/psr7:^1.3" | ||
method: "Http\\Discovery\\Psr18ClientDiscovery::find();" | ||
# Test that we find PSR-18 Symfony 5 | ||
- expect: will-find | ||
requirements: "symfony/http-client:^5 php-http/httplug nyholm/psr7:^1.3" | ||
method: "Http\\Discovery\\Psr18ClientDiscovery::find();" | ||
# Test that we find PSR-17 http-interop | ||
- expect: will-find | ||
requirements: "http-interop/http-factory-guzzle:^1" | ||
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();" | ||
# Test that we find PSR-17 nyholm | ||
- expect: will-find | ||
requirements: "nyholm/psr7:^1.3" | ||
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();" | ||
# Test that we find Phalcon with PSR | ||
- expect: will-find | ||
pecl: "psr-1.0.0, phalcon-4.0.6" | ||
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2 | ||
coverage: xdebug | ||
extensions: ${{ matrix.pecl }} | ||
|
||
- name: Check Install | ||
run: | | ||
tests/install.sh ${{ matrix.expect }} "${{ matrix.method }}" "${{ matrix.requirements }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Static analysis | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
php-cs-fixer: | ||
name: PHP-CS-Fixer | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: PHP-CS-Fixer | ||
uses: docker://oskarstark/php-cs-fixer-ga | ||
with: | ||
args: --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
/phpunit.xml | ||
/puli.json | ||
/vendor/ | ||
.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__.'/src') | ||
->name('*.php') | ||
; | ||
|
||
$config = (new PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@Symfony' => true, | ||
]) | ||
->setFinder($finder) | ||
; | ||
|
||
return $config; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.