|  | 
|  | 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 }}" | 
0 commit comments