From 5ed37ee7c302b6298390970c4621cd2c4286d222 Mon Sep 17 00:00:00 2001 From: Patrick O'Meara Date: Mon, 11 Mar 2024 14:22:18 +1100 Subject: [PATCH 1/8] Support Laravel 11 Only support two latest major versions of Laravel as per Support Policy https://laravel.com/docs/11.x/releases#support-policy Remove Laravel 9 and PHP 8.0 support --- .github/workflows/run-tests.yml | 14 +++++++------- composer.json | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 077915b..a017164 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,19 +9,19 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: ["8.0", "8.1", "8.2"] - laravel: ["^9.0", "^10.0"] + php: ["8.1", "8.2", "8.3"] + laravel: ["^10.0", "^11.0"] dependency-version: [prefer-lowest, prefer-stable] include: - - laravel: "^9.0" - testbench: "^7.0" - laravel: "^10.0" testbench: "^8.0" + - laravel: "^11.0" + testbench: "^9.0" exclude: - - php: "8.2" - laravel: "^9.0" - - php: "8.0" + - php: "8.3" laravel: "^10.0" + - php: "8.1" + laravel: "^11.0" name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index 3c5ec5f..7092275 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ } ], "require": { - "php": "^8.0", - "illuminate/contracts": "9.0 - 9.34 || ^9.36 || ^10.0", + "php": "^8.1", + "illuminate/contracts": "^10.0 || ^11.0", "lorisleiva/lody": "^0.4" }, "require-dev": { From 27e648a4af9e9f8214f607d163b0d2afeea98213 Mon Sep 17 00:00:00 2001 From: Patrick O'Meara Date: Mon, 11 Mar 2024 14:28:57 +1100 Subject: [PATCH 2/8] Use Compatible Lody version This commit can be removed and the correct version of lody use after https://github.com/lorisleiva/lody/pull/6 has been merged --- composer.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7092275..bb9ae5c 100644 --- a/composer.json +++ b/composer.json @@ -23,13 +23,19 @@ "require": { "php": "^8.1", "illuminate/contracts": "^10.0 || ^11.0", - "lorisleiva/lody": "^0.4" + "lorisleiva/lody": "dev-l11-compatibility" }, "require-dev": { "orchestra/testbench": "^8.5", "pestphp/pest": "^1.23", "phpunit/phpunit": "^9.6" }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/laravel-shift/lody.git" + } + ], "autoload": { "psr-4": { "Lorisleiva\\Actions\\": "src" From 6bdb23da7c22d7c379b47549c95c8d7d58a8c36a Mon Sep 17 00:00:00 2001 From: Patrick O'Meara Date: Wed, 13 Mar 2024 08:38:10 +1100 Subject: [PATCH 3/8] Allow later versions of pest and phpunit --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index bb9ae5c..55aa600 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,8 @@ }, "require-dev": { "orchestra/testbench": "^8.5", - "pestphp/pest": "^1.23", - "phpunit/phpunit": "^9.6" + "pestphp/pest": "^1.23 || ^2.0", + "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0" }, "repositories": [ { From 3db9b48cd3a44f039b58e8bd58f947f47c4a7125 Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Wed, 13 Mar 2024 12:23:09 +0000 Subject: [PATCH 4/8] wip --- .github/workflows/php-cs-fixer.yml | 2 +- .github/workflows/run-tests.yml | 2 +- composer.json | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index f55d1fa..0672942 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a017164..9447748 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index 55aa600..44d05a5 100644 --- a/composer.json +++ b/composer.json @@ -22,13 +22,13 @@ ], "require": { "php": "^8.1", - "illuminate/contracts": "^10.0 || ^11.0", - "lorisleiva/lody": "dev-l11-compatibility" + "illuminate/contracts": "^10.0|^11.0", + "lorisleiva/lody": "^0.5" }, "require-dev": { - "orchestra/testbench": "^8.5", - "pestphp/pest": "^1.23 || ^2.0", - "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0" + "orchestra/testbench": "^9.0", + "pestphp/pest": "^1.23|^2.34", + "phpunit/phpunit": "^9.6|^10.0" }, "repositories": [ { From e9f968321ea883cad4f87e0dc1181f8591521acf Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Wed, 13 Mar 2024 12:24:44 +0000 Subject: [PATCH 5/8] wip --- composer.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/composer.json b/composer.json index 44d05a5..174d954 100644 --- a/composer.json +++ b/composer.json @@ -30,12 +30,6 @@ "pestphp/pest": "^1.23|^2.34", "phpunit/phpunit": "^9.6|^10.0" }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/laravel-shift/lody.git" - } - ], "autoload": { "psr-4": { "Lorisleiva\\Actions\\": "src" From 696c982e47d1bdd7d1ade09655c99610fd037604 Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Wed, 13 Mar 2024 12:42:49 +0000 Subject: [PATCH 6/8] wip fun fun fun --- .gitignore | 2 +- phpunit.xml.dist | 60 ++++++++++++++++-------------------- tests/AsJobWithBatchTest.php | 9 ++++-- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index adc6804..81bd39d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .idea .php_cs .php_cs.cache -.phpunit.result.cache +.phpunit* build composer.lock coverage diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 05f3d81..12e7a6c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,36 +1,28 @@ - - - - tests - - - - - ./src - - - - - - - - - - - - - - - + + + + tests + + + + + + + + + + + + + + + + + + + + ./src + + diff --git a/tests/AsJobWithBatchTest.php b/tests/AsJobWithBatchTest.php index 71929c2..b7c848a 100644 --- a/tests/AsJobWithBatchTest.php +++ b/tests/AsJobWithBatchTest.php @@ -5,6 +5,7 @@ use Illuminate\Bus\Batch; use Illuminate\Support\Facades\Bus; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Str; use Lorisleiva\Actions\Concerns\AsJob; class AsJobWithBatchTest @@ -43,8 +44,12 @@ public function asJob(?Batch $batch, int $left, int $right) // And have a `job_batches` table. $this->artisan('migrate')->run(); - if (! Schema::hasTable('job_batches')) { - $this->artisan('queue:batches-table')->run(); + if (!Schema::hasTable('job_batches')) { + if (Str::startsWith($this->app->version(), "11.")) { + $this->artisan('make:queue-batches-table')->run(); + } else { + $this->artisan('queue:batches-table')->run(); + } $this->artisan('migrate')->run(); } }); From a982d0553b61c1fd36adfdb002ce8a37402dfbc5 Mon Sep 17 00:00:00 2001 From: lorisleiva Date: Wed, 13 Mar 2024 12:43:11 +0000 Subject: [PATCH 7/8] Fix styling --- tests/AsJobWithBatchTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AsJobWithBatchTest.php b/tests/AsJobWithBatchTest.php index b7c848a..a318ff5 100644 --- a/tests/AsJobWithBatchTest.php +++ b/tests/AsJobWithBatchTest.php @@ -44,7 +44,7 @@ public function asJob(?Batch $batch, int $left, int $right) // And have a `job_batches` table. $this->artisan('migrate')->run(); - if (!Schema::hasTable('job_batches')) { + if (! Schema::hasTable('job_batches')) { if (Str::startsWith($this->app->version(), "11.")) { $this->artisan('make:queue-batches-table')->run(); } else { From f571d9cc8fb54de0902ecb531e39c0b8f5e2d1ac Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Wed, 13 Mar 2024 12:45:45 +0000 Subject: [PATCH 8/8] wip --- .github/workflows/php-cs-fixer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 0672942..01de9df 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -18,6 +18,6 @@ jobs: args: --config=.php_cs.dist.php --allow-risky=yes - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Fix styling