diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8f5eccd..3391241 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,9 +19,9 @@ jobs: # PHPUnit ^11.5, so Laravel 10 rows always get Pest 2; Testbench 9+ rows # resolve Pest 3. include: - - { php: '8.1', laravel: '10.*', testbench: '8.*' } - - { php: '8.2', laravel: '10.*', testbench: '8.*' } - - { php: '8.3', laravel: '10.*', testbench: '8.*' } + - { php: '8.1', laravel: '10.*', testbench: '8.*', guzzle: '^7.2' } + - { php: '8.2', laravel: '10.*', testbench: '8.*', guzzle: '^7.2' } + - { php: '8.3', laravel: '10.*', testbench: '8.*', guzzle: '^7.2' } - { php: '8.2', laravel: '11.*', testbench: '9.*' } - { php: '8.3', laravel: '11.*', testbench: '9.*' } - { php: '8.4', laravel: '11.*', testbench: '9.*' } @@ -53,11 +53,62 @@ jobs: "laravel/framework:${{ matrix.laravel }}" \ "orchestra/testbench:${{ matrix.testbench }}" \ --no-interaction --no-update + # Laravel 10 only suggests Guzzle, leaving it to the app, whose + # skeleton requires ^7.2; later versions require it themselves. + if [ -n "${{ matrix.guzzle }}" ]; then + composer require "guzzlehttp/guzzle:${{ matrix.guzzle }}" --no-interaction --no-update + fi composer update --prefer-dist --no-interaction --no-progress - name: Run tests run: vendor/bin/pest + install: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - { php: '8.3', laravel: '10' } + - { php: '8.4', laravel: '11' } + - { php: '8.4', laravel: '12' } + - { php: '8.4', laravel: '13' } + + name: Install in Laravel ${{ matrix.laravel }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + path: package + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, fileinfo, pdo, sqlite3, pdo_sqlite + coverage: none + + # The app's dependencies are installed before the package is added, as in + # a real app, so a constraint that conflicts with what the framework + # already locked fails here. Resolved together, Composer would quietly + # pick versions that satisfy both. + - name: Create a Laravel application + run: | + composer create-project "laravel/laravel:^${{ matrix.laravel }}.0" app --no-install --no-scripts --no-interaction + cd app + # Laravel 10 is EOL and carries unpatched advisories; allow installing it. + composer config --no-plugins policy.advisories.block false + composer update --prefer-dist --no-interaction --no-progress + + - name: Install the package + working-directory: app + run: | + composer config repositories.eupago '{"type": "path", "url": "../package", "options": {"symlink": false, "versions": {"codetech/laravel-eupago": "dev-ci"}}}' + composer require codetech/laravel-eupago:dev-ci --no-interaction --no-progress + php artisan route:list --path=eupago + dependency-check: runs-on: ubuntu-latest name: Dependency check diff --git a/composer.json b/composer.json index 4688190..0a01d6b 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,6 @@ "license": "MIT", "require": { "php": "^8.1", - "guzzlehttp/guzzle": "^7.0", "illuminate/broadcasting": "^10.0|^11.0|^12.0|^13.0", "illuminate/cache": "^10.0|^11.0|^12.0|^13.0", "illuminate/database": "^10.0|^11.0|^12.0|^13.0", @@ -35,6 +34,9 @@ "illuminate/validation": "^10.0|^11.0|^12.0|^13.0", "nesbot/carbon": "^2.0|^3.0" }, + "suggest": { + "guzzlehttp/guzzle": "Required on Laravel 10 (^7.2), which leaves Guzzle to the application; later versions install it themselves." + }, "autoload": { "psr-4": { "CodeTech\\EuPago\\": "src/" diff --git a/docs/requirements.md b/docs/requirements.md index 3909d2b..b066cfb 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -10,4 +10,13 @@ group: Getting started | 2.x ([`2.x`](https://github.com/CodeTechAgency/laravel-eupago/tree/2.x)) | 9 / 10 | ≥ 8.0.2 | Security fixes | | 1.x ([`1.x`](https://github.com/CodeTechAgency/laravel-eupago/tree/1.x)) | 8 | ≥ 8.0 | End of life | +The package sends its requests through Laravel's HTTP client, which runs on Guzzle. Laravel 11 and later +install the Guzzle version they support. Laravel 10 leaves Guzzle to the application, and new +Laravel 10 applications already require it, so keep it in your `composer.json` at the version +Laravel 10 supports: + +```json +"guzzlehttp/guzzle": "^7.2" +``` + Upgrading from an older version? See the [upgrade guide](https://github.com/CodeTechAgency/laravel-eupago/blob/master/UPGRADE.md).