From 84474dc69785af2bf21df0a893934170139c0e27 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 19:37:34 +0800 Subject: [PATCH 01/11] feat: add Symfony version compatibility testing Add a new test job to verify compatibility with Symfony 6.0 and 7.0 across PHP versions 8.2-8.4. This ensures our components work correctly with different Symfony versions. --- .github/workflows/test-components.yml | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index a67b0764f..7e66aee49 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -106,3 +106,33 @@ jobs: run: | composer analyse src composer analyse:types + symfony: + name: Test for Symfony Components + runs-on: 'ubuntu-latest' + env: + PHP_VERSION: ${{ matrix.php-version }} + strategy: + matrix: + php-version: [ '8.4', '8.3', '8.2' ] + symfony: [ '7.0', '6.0' ] + max-parallel: 20 + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: phpize + extensions: redis, pdo, pdo_mysql, bcmath, swoole + ini-values: opcache.enable_cli=1 + coverage: none + - name: Setup Packages + run: | + for package in `cat composer.json|grep "symfony/"| awk -F '"' '{print $2}'`; do composer require "${package}:${{ matrix.symfony }}" --dev --no-update; done + composer update -o + - name: Run Test Cases + run: | + composer analyse src + composer analyse:types From 23f01452e76e1c28a261f6fc5a12c298c527e1ad Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 19:40:16 +0800 Subject: [PATCH 02/11] fix: exclude polyfill packages from Symfony version requirement in workflow --- .github/workflows/test-components.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index 7e66aee49..40f6f59d5 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -130,7 +130,9 @@ jobs: coverage: none - name: Setup Packages run: | - for package in `cat composer.json|grep "symfony/"| awk -F '"' '{print $2}'`; do composer require "${package}:${{ matrix.symfony }}" --dev --no-update; done + for package in `cat composer.json|grep "symfony/" | grep -v "polyfill" | awk -F '"' '{print $2}'`; do + composer require "${package}:${{ matrix.symfony }}" --dev --no-update; + done composer update -o - name: Run Test Cases run: | From 16811b9e0e17c6fadfb627d31c9f30f20954c759 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 19:41:47 +0800 Subject: [PATCH 03/11] fix: update Symfony package version constraint to use caret notation --- .github/workflows/test-components.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index 40f6f59d5..18b01ac8d 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -131,7 +131,7 @@ jobs: - name: Setup Packages run: | for package in `cat composer.json|grep "symfony/" | grep -v "polyfill" | awk -F '"' '{print $2}'`; do - composer require "${package}:${{ matrix.symfony }}" --dev --no-update; + composer require "${package}:^${{ matrix.symfony }}" --dev --no-update; done composer update -o - name: Run Test Cases From ff2c55b0565a0a90bc5e29f37f32fc0228ff56fc Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 19:43:12 +0800 Subject: [PATCH 04/11] fix: update version constraints to use caret notation for dependencies in workflow --- .github/workflows/test-components.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index 18b01ac8d..f4afe91d7 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: php-version: [ '8.4', '8.3', '8.2' ] - mysql-replication: [ '9.0', '8.0' ] + mysql-replication: [ '^9.0', '^8.0' ] max-parallel: 2 fail-fast: false steps: @@ -40,7 +40,7 @@ jobs: coverage: none - name: Setup Packages run: | - composer require krowinski/php-mysql-replication:^${{ matrix.mysql-replication }} --no-update + composer require krowinski/php-mysql-replication:${{ matrix.mysql-replication }} --no-update composer update -o - name: Run Test Cases run: | @@ -54,7 +54,7 @@ jobs: strategy: matrix: php-version: [ '8.4', '8.3', '8.2' ] - serializable-closure: [ '2.0', '1.0' ] + serializable-closure: [ '^2.0', '^1.0' ] max-parallel: 20 fail-fast: false steps: @@ -70,7 +70,7 @@ jobs: coverage: none - name: Setup Packages run: | - composer require laravel/serializable-closure:^${{ matrix.serializable-closure }} --no-update + composer require laravel/serializable-closure:${{ matrix.serializable-closure }} --no-update composer update -o - name: Run Test Cases run: | @@ -84,7 +84,7 @@ jobs: strategy: matrix: php-version: [ '8.4', '8.3', '8.2' ] - carbon: [ '3.0', '2.0' ] + carbon-version: [ '^3.0', '^2.0' ] max-parallel: 20 fail-fast: false steps: @@ -100,7 +100,7 @@ jobs: coverage: none - name: Setup Packages run: | - composer require nesbot/carbon:^${{ matrix.carbon }} --no-update + composer require nesbot/carbon:${{ matrix.carbon-version }} --no-update composer update -o - name: Run Test Cases run: | @@ -114,7 +114,7 @@ jobs: strategy: matrix: php-version: [ '8.4', '8.3', '8.2' ] - symfony: [ '7.0', '6.0' ] + symfony-version: [ '^7.0', '^6.0' ] max-parallel: 20 fail-fast: false steps: @@ -131,7 +131,7 @@ jobs: - name: Setup Packages run: | for package in `cat composer.json|grep "symfony/" | grep -v "polyfill" | awk -F '"' '{print $2}'`; do - composer require "${package}:^${{ matrix.symfony }}" --dev --no-update; + composer require "${package}:${{ matrix.symfony-version }}" --dev --no-update; done composer update -o - name: Run Test Cases From f0e89f0845986bb58a735669a4a60c2a4b01f405 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 19:44:29 +0800 Subject: [PATCH 05/11] fix: reduce max-parallel jobs to 4 for consistency across workflows --- .github/workflows/test-components.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index f4afe91d7..a93b9d998 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -25,7 +25,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] mysql-replication: [ '^9.0', '^8.0' ] - max-parallel: 2 + max-parallel: 4 fail-fast: false steps: - name: Checkout @@ -55,7 +55,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] serializable-closure: [ '^2.0', '^1.0' ] - max-parallel: 20 + max-parallel: 4 fail-fast: false steps: - name: Checkout @@ -85,7 +85,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] carbon-version: [ '^3.0', '^2.0' ] - max-parallel: 20 + max-parallel: 4 fail-fast: false steps: - name: Checkout @@ -115,7 +115,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] symfony-version: [ '^7.0', '^6.0' ] - max-parallel: 20 + max-parallel: 4 fail-fast: false steps: - name: Checkout From 556614fb7769aad5196d6a71cb79cb0116ffbb58 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:09:32 +0800 Subject: [PATCH 06/11] fix: remove pestphp packages from Symfony testing workflow --- .github/workflows/test-components.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index a93b9d998..2f55f9988 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -130,6 +130,7 @@ jobs: coverage: none - name: Setup Packages run: | + composer remove pestphp/* --dev --no-update for package in `cat composer.json|grep "symfony/" | grep -v "polyfill" | awk -F '"' '{print $2}'`; do composer require "${package}:${{ matrix.symfony-version }}" --dev --no-update; done From 7fde6d6f09740e7bc17d32d830d10dbec6f7c318 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:11:20 +0800 Subject: [PATCH 07/11] fix: increase max-parallel jobs to 10 for all workflows --- .github/workflows/test-components.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index 2f55f9988..466375b59 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -25,7 +25,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] mysql-replication: [ '^9.0', '^8.0' ] - max-parallel: 4 + max-parallel: 10 fail-fast: false steps: - name: Checkout @@ -55,7 +55,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] serializable-closure: [ '^2.0', '^1.0' ] - max-parallel: 4 + max-parallel: 10 fail-fast: false steps: - name: Checkout @@ -85,7 +85,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] carbon-version: [ '^3.0', '^2.0' ] - max-parallel: 4 + max-parallel: 10 fail-fast: false steps: - name: Checkout @@ -115,7 +115,7 @@ jobs: matrix: php-version: [ '8.4', '8.3', '8.2' ] symfony-version: [ '^7.0', '^6.0' ] - max-parallel: 4 + max-parallel: 10 fail-fast: false steps: - name: Checkout From 0b2c82532e4ef161802544e95066750493cdc327 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:14:03 +0800 Subject: [PATCH 08/11] fix: exclude .vscode directory from workflow paths --- .github/workflows/test-components.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index 466375b59..138305246 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -5,11 +5,13 @@ on: paths: - "**" - "!docs/**" + - "!.vscode/**" - "!**.md" pull_request: paths: - "**" - "!docs/**" + - "!.vscode/**" - "!**.md" schedule: - cron: '0 2 * * *' From 98c33e3504d356da521a5c92d6da4180e17bb33c Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:23:26 +0800 Subject: [PATCH 09/11] fix: update job name for Nesbot Carbon in workflow --- .github/workflows/test-components.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index 138305246..c44c81ef9 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -79,7 +79,7 @@ jobs: composer analyse src composer analyse:types carbon: - name: Test for Carbon + name: Test for Nesbot Carbon runs-on: 'ubuntu-latest' env: PHP_VERSION: ${{ matrix.php-version }} From e41eba2ca5a01ec86e8cd89467c4eaa49e6667d0 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:25:18 +0800 Subject: [PATCH 10/11] fix: update pestphp package versions for compatibility --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index f1f524f5f..3d8cc5956 100644 --- a/composer.json +++ b/composer.json @@ -101,9 +101,9 @@ "mockery/mockery": "^1.6", "opis/closure": "^3.6", "overtrue/easy-sms": "^3.0", - "pestphp/pest": "^3.0", - "pestphp/pest-plugin-faker": "^3.0", - "pestphp/pest-plugin-type-coverage": "^3.0", + "pestphp/pest": "^2.0 || ^3.0", + "pestphp/pest-plugin-faker": "^2.0 || ^3.0", + "pestphp/pest-plugin-type-coverage": "^2.0 || ^3.0", "php-http/guzzle7-adapter": "^1.0", "phpstan/phpstan": "^1.0", "phpstan/phpstan-deprecation-rules": "^1.1", From 5f2629f83ef756ddc4dc278e9bf7d3bf46ca53ba Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:26:01 +0800 Subject: [PATCH 11/11] fix: remove pestphp package removal from Symfony testing workflow --- .github/workflows/test-components.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index c44c81ef9..e2b2dedad 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -132,7 +132,6 @@ jobs: coverage: none - name: Setup Packages run: | - composer remove pestphp/* --dev --no-update for package in `cat composer.json|grep "symfony/" | grep -v "polyfill" | awk -F '"' '{print $2}'`; do composer require "${package}:${{ matrix.symfony-version }}" --dev --no-update; done