Skip to content

Commit 6a53322

Browse files
authored
switch to github workflow (#206)
1 parent 98ead1f commit 6a53322

25 files changed

+277
-202
lines changed

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/checks.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
roave-bc-check:
11+
name: Roave BC Check
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Roave BC Check
19+
uses: "docker://nyholm/roave-bc-check-ga"

.github/workflows/ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
latest:
11+
name: PHP ${{ matrix.php }} Latest
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
tools: composer:v2
26+
coverage: none
27+
28+
- name: Install PHP 7 dependencies
29+
run: composer update --prefer-dist --no-interaction --no-progress
30+
if: "startsWith(matrix.php, '7.')"
31+
32+
- name: Install PHP 8 dependencies
33+
run: |
34+
composer require "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update
35+
composer update --prefer-dist --prefer-stable --no-interaction --no-progress --ignore-platform-req=php
36+
if: "startsWith(matrix.php, '8.')"
37+
38+
- name: Execute tests
39+
run: composer test
40+
41+
lowest:
42+
name: PHP ${{ matrix.php }} Lowest
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
php: ['7.1', '7.4']
47+
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v2
51+
52+
- name: Setup PHP
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
tools: composer:v1
57+
coverage: none
58+
59+
- name: Install dependencies
60+
run: |
61+
wget https://github.com/puli/cli/releases/download/1.0.0-beta9/puli.phar && chmod +x puli.phar
62+
composer require "sebastian/comparator:^3.0.2" "puli/composer-plugin:1.0.0-beta9" --no-interaction --no-update
63+
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
64+
65+
- name: Execute tests
66+
run: composer test
67+
68+
coverage:
69+
name: Code Coverage
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v2
75+
76+
- name: Setup PHP
77+
uses: shivammathur/setup-php@v2
78+
with:
79+
php-version: 7.4
80+
tools: composer:v2
81+
coverage: xdebug
82+
83+
- name: Install dependencies
84+
run: |
85+
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update
86+
composer update --prefer-dist --no-interaction --no-progress
87+
88+
- name: Execute tests
89+
run: composer test-ci
90+
91+
- name: Upload coverage
92+
run: |
93+
wget https://scrutinizer-ci.com/ocular.phar
94+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

.github/workflows/installation.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Installation
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
installation:
10+
name: Installation test ${{ matrix.expect }} ${{ matrix.method }} ${{ matrix.requirements }} ${{ matrix.pecl }}
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
include:
16+
# Test that we find Guzzle 6 v1
17+
- expect: will-find
18+
requirements: "php-http/guzzle6-adapter:^1.1.1"
19+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
20+
# Test that we find Guzzle 6 v2
21+
- expect: will-find
22+
requirements: "php-http/guzzle6-adapter:^2.0.1"
23+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
24+
# Test that we find Guzzle 7 Adapter
25+
- expect: will-find
26+
requirements: "php-http/guzzle7-adapter:^0.1"
27+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
28+
# Test that we find a client with Symfony and Guzzle PSR-7
29+
- expect: will-find
30+
requirements: "symfony/http-client:^5 php-http/httplug php-http/message-factory guzzlehttp/psr7:^1 http-interop/http-factory-guzzle"
31+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
32+
# We should fail if we dont have php-http/message-factory or PSR-17
33+
- expect: cant-find
34+
requirements: "symfony/http-client:^5 php-http/httplug php-http/message-factory guzzlehttp/psr7:^1"
35+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
36+
- expect: cant-find
37+
requirements: "symfony/http-client:^5 php-http/httplug guzzlehttp/psr7:^1 http-interop/http-factory-guzzle"
38+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
39+
# We should be able to find a client when Symfony is only partly installed and we have guzzle adapter installed
40+
- expect: will-find
41+
requirements: "symfony/http-client:^5 php-http/guzzle6-adapter php-http/httplug php-http/message-factory guzzlehttp/psr7:^1"
42+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
43+
# Test that we find a client with Symfony and Guzzle
44+
- expect: will-find
45+
requirements: "php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter"
46+
method: "Http\\Discovery\\HttpClientDiscovery::find();"
47+
# Test that we find an async client with Symfony and Guzzle
48+
- expect: will-find
49+
requirements: "php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter"
50+
method: "Http\\Discovery\\HttpAsyncClientDiscovery::find();"
51+
# Test that we find PSR-18 Guzzle 6
52+
- expect: will-find
53+
requirements: "php-http/guzzle6-adapter:^2.0.1"
54+
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
55+
# Test that we find PSR-18 Guzzle 7
56+
- expect: will-find
57+
requirements: "guzzlehttp/guzzle:^7.0.1"
58+
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
59+
# Test that we find PSR-18 Symfony 4
60+
- expect: will-find
61+
requirements: "symfony/http-client:^4 php-http/httplug nyholm/psr7:^1.3"
62+
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
63+
# Test that we find PSR-18 Symfony 5
64+
- expect: will-find
65+
requirements: "symfony/http-client:^5 php-http/httplug nyholm/psr7:^1.3"
66+
method: "Http\\Discovery\\Psr18ClientDiscovery::find();"
67+
# Test that we find PSR-17 http-interop
68+
- expect: will-find
69+
requirements: "http-interop/http-factory-guzzle:^1"
70+
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();"
71+
# Test that we find PSR-17 nyholm
72+
- expect: will-find
73+
requirements: "nyholm/psr7:^1.3"
74+
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();"
75+
# Test that we find Phalcon with PSR
76+
- expect: will-find
77+
pecl: "psr-1.0.0, phalcon-4.0.6"
78+
method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();"
79+
80+
steps:
81+
- name: Checkout code
82+
uses: actions/checkout@v2
83+
84+
- name: Setup PHP
85+
uses: shivammathur/setup-php@v2
86+
with:
87+
php-version: 7.4
88+
tools: composer:v2
89+
coverage: xdebug
90+
extensions: ${{ matrix.pecl }}
91+
92+
- name: Check Install
93+
run: |
94+
tests/install.sh ${{ matrix.expect }} "${{ matrix.method }}" "${{ matrix.requirements }}"

.github/workflows/static.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Static analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
php-cs-fixer:
11+
name: PHP-CS-Fixer
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: PHP-CS-Fixer
19+
uses: docker://oskarstark/php-cs-fixer-ga
20+
with:
21+
args: --dry-run

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/phpunit.xml
77
/puli.json
88
/vendor/
9+
.php-cs-fixer.cache

.php-cs-fixer.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->name('*.php')
6+
;
7+
8+
$config = (new PhpCsFixer\Config())
9+
->setRiskyAllowed(true)
10+
->setRules([
11+
'@Symfony' => true,
12+
])
13+
->setFinder($finder)
14+
;
15+
16+
return $config;

.php_cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

.scrutinizer.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.styleci.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)