Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Fixed CI for PHP 7.2 #1188

Merged
merged 1 commit into from
Dec 27, 2023
Merged

[CI] Fixed CI for PHP 7.2 #1188

merged 1 commit into from
Dec 27, 2023

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Dec 24, 2023

This PR is my attempt at fixing the "always green" build for 7.2 (mentioned in #1183 (comment))

Things done:

  1. I've bumped the PHPUnit Bridge version to the latest one.

According to PHPUnit Bridge doc:

The PHPUnit bridge is designed to work with all maintained versions of Symfony components, even across different major versions of them. You should always use its very latest stable major version to get the most accurate deprecation report.

Allowing phpunit-bridge range of "^4.4|^5.4|^6.0|^7.0" together with --prefer-lowest means that the 4.4.0 version of it is installed - which doesn't have all the required bugfixes.

I've chosen ^7.0 as the latest one, for the 7.x series 7.0.1 is needed because it contains the bugfix for this issue: symfony/demo#1457 (comment)

  1. Set PHPUnit 9.5 as the max version

The 7.2 build cannot use PHPUnit 9.5, it requires PHP 7.3

I've set this as max version instead - it will be used if possible, otherwise lower versions will be used.

  1. Bumped lowest supported version of lcobucci/jwt to 3.4.6

One of the tests was failing:

1) Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\GetTokenTest::testGetTokenWithCustomClaim
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
 Array &0 (
     0 => 'foo'
-    1 => 'bar'
 )

This was fixed by bumping the version of lcobucci/jwt to 3.4.6 - I suspect it contains bugfix not present in 3.4.0

  1. Run PHP 7.2 tests on ubuntu-20

I found this issue when googling: shivammathur/setup-php#720

If you are running this on the ubuntu-latest or ubuntu-22.04 runner, that has OpenSSL 3 and support for it was added to PHP in 8.1. Please use ubuntu-20.04 runner with the older PHP versions and this should work.

And it was right, all of a sudden the segmentation faults have disappeared.

Overall I feel everything I did was a bit hacky, but the build is now green 🎉

@mnocon mnocon marked this pull request as draft December 26, 2023 13:20
@mnocon mnocon force-pushed the fix-7.2-build branch 4 times, most recently from 54ca7c8 to 7ec28d6 Compare December 26, 2023 15:06
@mnocon mnocon marked this pull request as ready for review December 26, 2023 15:14
@chalasr
Copy link
Collaborator

chalasr commented Dec 27, 2023

Thanks a lot @mnocon, much appreciated!

@chalasr chalasr merged commit f457c3d into lexik:2.x Dec 27, 2023
9 checks passed
@mnocon mnocon deleted the fix-7.2-build branch January 3, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants