From f16121a91067357aeb6b72a543985cca162a3d20 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Fri, 18 Oct 2024 11:42:36 +0200 Subject: [PATCH 1/2] Allow tests to run on PHP8.4 This then also prepares the package to be released for PHP8.4 runtimes --- .github/workflows/ci.yaml | 17 +++++++++++++++++ app/composer.json | 2 +- composer.json | 2 +- src/backup-code/composer.json | 2 +- src/bundle/composer.json | 2 +- src/email/composer.json | 2 +- src/google-authenticator/composer.json | 2 +- src/totp/composer.json | 2 +- src/trusted-device/composer.json | 2 +- 9 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a0895712..e2c96397 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,9 +57,18 @@ jobs: - php-version: '8.3' symfony-version: '6.4.*' + # Test against Symfony 6.4 on PHP8.4 + - php-version: '8.4' + symfony-version: '6.4.*' + # Test against Symfony 7 - php-version: '8.3' symfony-version: '7.*' + + # Test against Symfony 7 on PHP8.4 + - php-version: '8.4' + symfony-version: '7.*' + steps: - name: 'Checkout code' uses: actions/checkout@v4 @@ -93,6 +102,14 @@ jobs: # Test against Symfony 7.* - php-version: '8.3' symfony-version: '7.*' + + # Minimum PHP version + - php-version: '8.4' + symfony-version: '6.4.*' + + # Test against Symfony 7.* + - php-version: '8.4' + symfony-version: '7.*' steps: - name: 'Checkout code' uses: actions/checkout@v4 diff --git a/app/composer.json b/app/composer.json index 41749b9f..767d310f 100644 --- a/app/composer.json +++ b/app/composer.json @@ -2,7 +2,7 @@ "type": "project", "license": "MIT", "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "ext-json": "*", "doctrine/doctrine-bundle": "^2.0.3", "doctrine/orm": "^2.9 || ^3.0", diff --git a/composer.json b/composer.json index 8349f284..1f027278 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "ext-json": "*", "lcobucci/clock": "^3.0", "lcobucci/jwt": "^5.0", diff --git a/src/backup-code/composer.json b/src/backup-code/composer.json index 539ad3b7..31182cf9 100644 --- a/src/backup-code/composer.json +++ b/src/backup-code/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "scheb/2fa-bundle": "self.version" }, "autoload": { diff --git a/src/bundle/composer.json b/src/bundle/composer.json index f4ed9849..c13d0140 100644 --- a/src/bundle/composer.json +++ b/src/bundle/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "ext-json": "*", "symfony/config": "^6.4 || ^7.0", "symfony/dependency-injection": "^6.4 || ^7.0", diff --git a/src/email/composer.json b/src/email/composer.json index 8cfa5d2b..dd134fe6 100644 --- a/src/email/composer.json +++ b/src/email/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "scheb/2fa-bundle": "self.version" }, "autoload": { diff --git a/src/google-authenticator/composer.json b/src/google-authenticator/composer.json index aaa40813..a84283aa 100644 --- a/src/google-authenticator/composer.json +++ b/src/google-authenticator/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "scheb/2fa-bundle": "self.version", "spomky-labs/otphp": "^11.0" }, diff --git a/src/totp/composer.json b/src/totp/composer.json index 4231ef88..78e1e2ac 100644 --- a/src/totp/composer.json +++ b/src/totp/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "scheb/2fa-bundle": "self.version", "spomky-labs/otphp": "^11.0" }, diff --git a/src/trusted-device/composer.json b/src/trusted-device/composer.json index 8b363963..6625b698 100644 --- a/src/trusted-device/composer.json +++ b/src/trusted-device/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "scheb/2fa-bundle": "self.version", "lcobucci/clock": "^3.0", "lcobucci/jwt": "^5.0" From 99a9ccd58b4f4b10a891dbcc084cb33b0ef1e7a4 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Sat, 19 Oct 2024 19:23:52 +0200 Subject: [PATCH 2/2] Remove psalm from most installations As Psalm is only used in one single job it can be removed in general and then reinstalled when it is actually required before it is executed. This process allows to keep Psalm in the dev-dependencies so that constributors still have it available but in CI-runs it needs not to be installed when it is not executed. --- .github/actions/setup-build/action.yaml | 4 ++++ .github/workflows/ci.yaml | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-build/action.yaml b/.github/actions/setup-build/action.yaml index e255be5d..9cf289e8 100644 --- a/.github/actions/setup-build/action.yaml +++ b/.github/actions/setup-build/action.yaml @@ -66,6 +66,10 @@ runs: shell: bash run: composer require ${{ inputs.composer-require }} --dev --no-update --working-dir=${{ inputs.composer-working-dir }} + - name: "Remove Psalm from dependencies" + shell: bash + run: composer remove --dev vimeo/psalm + - name: "Validate composer.json" shell: bash run: composer validate --no-check-publish --no-check-lock --working-dir=${{ inputs.composer-working-dir }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e2c96397..3d89c6e4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,7 +36,9 @@ jobs: - name: "Psalm" if: always() - run: vendor/bin/psalm + run: | + composer require -W --dev vimeo/psalm:^5.0 + vendor/bin/psalm unit-tests: name: "Unit Tests - PHP ${{ matrix.php-version }}, Sf ${{ matrix.symfony-version }}${{ matrix.dependency-versions && format(', Deps: {0}', matrix.dependency-versions) }}"