-
Notifications
You must be signed in to change notification settings - Fork 49
101 lines (95 loc) · 4.93 KB
/
installation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Installation
on:
push:
branches:
- "*.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
- 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 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 php-http/message-factory 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 php-http/message-factory 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@v3
- 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 }}"
- name: Run Tests
run: |
composer remove --dev --no-update php-http/httplug php-http/message-factory
composer require --dev ${{ matrix.requirements }}
vendor/bin/simple-phpunit
if: "matrix.expect == 'will-find' && matrix.method != 'Http\\Discovery\\HttpClientDiscovery::find();' && matrix.method != 'Http\\Discovery\\HttpAsyncClientDiscovery::find();' && matrix.pecl != 'psr-1.0.0, phalcon-4.0.6'"