From 517830e40bf745e52d308364900a9cb9dbbd2ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Llorens?= Date: Thu, 26 Sep 2024 12:13:22 +0200 Subject: [PATCH 1/3] Actualizar compatibilidad con laravel 11 --- .github/workflows/analyse.yml | 36 ++++++++++++++++++ .github/workflows/test.yml | 70 +++++++++++++++++++++++++++++++++++ composer.json | 12 +++--- 3 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/analyse.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml new file mode 100644 index 0000000..9de7fda --- /dev/null +++ b/.github/workflows/analyse.yml @@ -0,0 +1,36 @@ +name: Analyse + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + phpstan: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.0 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-8.0-${{ hashFiles('**/composer.json') }} + restore-keys: | + ${{ runner.os }}-php-8.0- + + - name: Install dependencies + run: | + composer install --no-interaction --no-progress + + - name: Run analyse phpstan + run: vendor/bin/phpstan analyse --error-format github diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..18c64b8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,70 @@ +name: Tests + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + phpunit: + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + php: [8.1, 8.2, 8.3] + laravel: [8.*, 9.*, 10.*, 11.*] + include: + - laravel: 8.* + testbench: 6.* + - laravel: 9.* + testbench: 7.* + - laravel: 10.* + testbench: 8.* + - laravel: 11.* + testbench: 9.* + exclude: + - laravel: 8.* + php: 8.2, 8.3 + - laravel: 9.* + php: 8.3 + - laravel: 11.* + php: 8.1 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: curl, pdo, sqlite, pdo_sqlite + + - name: Install SQLite 3 + run: | + sudo apt-get update + sudo apt-get install sqlite3 + + - name: Validate composer.json + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}- + + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --prefer-stable --prefer-dist --no-interaction + + - name: Run test phpunit + run: vendor/bin/phpunit --stop-on-error --stop-on-failure diff --git a/composer.json b/composer.json index 265e63f..bfaf369 100644 --- a/composer.json +++ b/composer.json @@ -15,12 +15,15 @@ } ], "require": { - "php": "^7.2", - "guzzlehttp/guzzle": "^6.5" + "php": "^7.3|^8.0", + "illuminate/config": "^8.0|^9.0|^10.0|^11.0", + "illuminate/events": "^8.0|^9.0|^10.0|^11.0", + "guzzlehttp/guzzle": "^7.0|^7.5|^8.0|^9.0" }, "require-dev": { - "phpunit/phpunit": "^8.0", - "orchestra/testbench": "^3.8.0|^4.0", + "phpstan/phpstan": "^1.2", + "phpunit/phpunit": "^9.0|^9.3|^10.0|^10.5", + "orchestra/testbench": "^6.0|^7.5|^8.0|^9.0", "plesk/api-php-lib": "^1.0" }, "suggest": { @@ -39,7 +42,6 @@ "scripts": { "test": "vendor/bin/phpunit", "test-coverage": "vendor/bin/phpunit --coverage-txt" - }, "config": { "sort-packages": true From 500c79d0ed825fe1622acec81cff21d91fd2490b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Llorens?= Date: Thu, 26 Sep 2024 12:18:26 +0200 Subject: [PATCH 2/3] Fix test.yml --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18c64b8..781bef0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,9 @@ jobs: testbench: 9.* exclude: - laravel: 8.* - php: 8.2, 8.3 + php: 8.2 + - laravel: 8.* + php: 8.3 - laravel: 9.* php: 8.3 - laravel: 11.* From 298c678ea7ad159326985725e9fa031ba3573016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Llorens?= Date: Thu, 26 Sep 2024 12:21:30 +0200 Subject: [PATCH 3/3] Fix analyse.yml --- .github/workflows/analyse.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 9de7fda..9de01e6 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -33,4 +33,4 @@ jobs: composer install --no-interaction --no-progress - name: Run analyse phpstan - run: vendor/bin/phpstan analyse --error-format github + run: vendor/bin/phpstan analyse src tests --error-format github