Skip to content
Closed
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
47 changes: 44 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,91 +3,132 @@ name: CI
on:
push:
branches:
- "*.x"
- *.x
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', '8.1', '8.2', '8.3', '8.4']



steps:
- name: Checkout code
uses: actions/checkout@v3



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



- name: Emulate PHP 8.3
run: composer config platform.php 8.3.999
if: matrix.php == '8.4'
if: "matrix.php == '8.4'"



- name: Install dependencies
run: |
composer update --prefer-dist --no-interaction --no-progress
vendor/bin/simple-phpunit install



- name: Execute tests
run: composer test

lowest:
name: PHP ${{ matrix.php }} Lowest



runs-on: ubuntu-latest


strategy:
matrix:
php: ['7.1', '7.4']
php: ['7.1', '7.4', '8.3', '8.4', '8.5']



steps:
- name: Checkout code
uses: actions/checkout@v3



- 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
vendor/bin/simple-phpunit install



- name: Execute tests
run: composer test

coverage:
name: Code Coverage



runs-on: ubuntu-latest



steps:
- name: Checkout code
uses: actions/checkout@v3



- 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
Expand Down
83 changes: 35 additions & 48 deletions .github/workflows/installation.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,68 @@
name: Installation

on:
push:
branches:
- "*.x"
- *.x
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
requirements: php-http/guzzle6-adapter:^1.1.1
method: Http\Discovery\HttpClientDiscovery::find();
- expect: will-find
requirements: "php-http/guzzle6-adapter:^2.0.1"
method: "Http\\Discovery\\HttpClientDiscovery::find();"
# Test that we find Guzzle 7 Adapter
requirements: php-http/guzzle6-adapter:^2.0.1
method: Http\Discovery\HttpClientDiscovery::find();
- 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
requirements: php-http/guzzle7-adapter:^0.1
method: Http\Discovery\HttpClientDiscovery::find();
- 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
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();
- expect: cant-find
requirements: "symfony/http-client:^5 php-http/httplug guzzlehttp/psr7:^1"
method: "Http\\Discovery\\HttpClientDiscovery::find();"
requirements: symfony/http-client:^5 php-http/httplug 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
requirements: symfony/http-client:^5 php-http/httplug guzzlehttp/psr7:^1 http-interop/http-factory-guzzle
method: Http\Discovery\HttpClientDiscovery::find();
- 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
requirements: symfony/http-client:^5 php-http/guzzle6-adapter php-http/httplug php-http/message-factory guzzlehttp/psr7:^1
method: Http\Discovery\HttpClientDiscovery::find();
- 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
requirements: php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter
method: Http\Discovery\HttpClientDiscovery::find();
- 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
requirements: php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter
method: Http\Discovery\HttpAsyncClientDiscovery::find();
- expect: will-find
requirements: "php-http/guzzle6-adapter:^2.0.1"
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
# Test that we find PSR-18 Guzzle 7
requirements: php-http/guzzle6-adapter:^2.0.1
method: Http\Discovery\Psr18ClientDiscovery::find();
- expect: will-find
requirements: "guzzlehttp/guzzle:^7.0.1"
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
# Test that we find PSR-18 Symfony 4
requirements: guzzlehttp/guzzle:^7.0.1
method: Http\Discovery\Psr18ClientDiscovery::find();
- expect: will-find
requirements: "symfony/http-client:^4 php-http/httplug php-http/message-factory nyholm/psr7:^1.3"
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
# Test that we find PSR-18 Symfony 5
requirements: symfony/http-client:^4 php-http/httplug php-http/message-factory nyholm/psr7:^1.3
method: Http\Discovery\Psr18ClientDiscovery::find();
- expect: will-find
requirements: "symfony/http-client:^5 php-http/httplug php-http/message-factory nyholm/psr7:^1.3"
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
# Test that we find PSR-17 http-interop
requirements: symfony/http-client:^5 php-http/httplug php-http/message-factory nyholm/psr7:^1.3
method: Http\Discovery\Psr18ClientDiscovery::find();
- expect: will-find
requirements: "http-interop/http-factory-guzzle:^1"
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();"
# Test that we find PSR-17 nyholm
requirements: http-interop/http-factory-guzzle:^1
method: Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();
- expect: will-find
requirements: "nyholm/psr7:^1.3"
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();"
# Test that we find Phalcon with PSR
requirements: nyholm/psr7:^1.3
method: Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();
- expect: will-find
pecl: "psr-1.0.0, phalcon-4.0.6"
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();"
pecl: psr-1.0.0, phalcon-4.0.6
method: Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();

steps:
- name: Checkout code
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Plugin

on:
push:
branches:
Expand All @@ -8,6 +9,7 @@ on:
jobs:
plugin:
name: Plugin test with Composer ${{ matrix.composer }}

runs-on: ubuntu-latest

strategy:
Expand Down
Loading