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

Test on PHP 8 #745

Merged
merged 7 commits into from
Dec 10, 2020
Merged

Test on PHP 8 #745

merged 7 commits into from
Dec 10, 2020

Conversation

mfn
Copy link
Contributor

@mfn mfn commented Dec 1, 2020

Evaluating what it takes to make things run on PHP 8.

Turns out most dev dependencies, which are not used in the actual unit test matrix, are not needed and by removing them there, we can at run the test suite on PHP 7.1 to PHP 8.0

@simPod
Copy link
Collaborator

simPod commented Dec 1, 2020

@mfn AFAIK GA does not allow something in matrix to fail yet

@coveralls
Copy link

coveralls commented Dec 1, 2020

Coverage Status

Coverage remained the same at 86.185% when pulling 290eb18 on mfn:mfn-gha into 8795c03 on webonyx:master.

@mfn
Copy link
Contributor Author

mfn commented Dec 1, 2020

@simPod

AFAIK GA does not allow something in matrix to fail yet

Not sure what you mean exactly, fail-fast is true by default and will abort the whole matrix if one job fails.

@mfn mfn marked this pull request as ready for review December 1, 2020 07:45
@simPod
Copy link
Collaborator

simPod commented Dec 1, 2020

Yup, I remember that in travis you could specify allowed failures. So I guess that's the reason 8.0 was not tested yet as it could not be allowed to fail. Just a note, keep going :D

@mfn
Copy link
Contributor Author

mfn commented Dec 1, 2020

keep going

Well yes, that's it for now :)

Depends on whether this is acceptable but I figured since composer.json supports php8 but you can't even install things locally until the dependencies are fixed, I figured it's also worth running the tests and we later remove the composer modifications once the issues are solved?

@simPod
Copy link
Collaborator

simPod commented Dec 1, 2020

You can run --ignore-platform-req=php to install those.

@mfn
Copy link
Contributor Author

mfn commented Dec 1, 2020

Doesn't seem to want to play together with 7.1 => https://github.com/webonyx/graphql-php/pull/745/checks?check_run_id=1478696970#step:7:8

@simPod
Copy link
Collaborator

simPod commented Dec 1, 2020

You should ignore platform php req only for php8. Now it installs incompatible phpunit (8.5) for php7.1

@mfn
Copy link
Contributor Author

mfn commented Dec 1, 2020

I thought so.

I'm just not sure this is the better approach?

In fact, I like my approach of removing dependencies not necessary for the tests, as it will also speed them up because they neither need to be resolved/installed/cached.

What do you think?

@simPod
Copy link
Collaborator

simPod commented Dec 1, 2020

Just mentioned the possibility in reaction to 👇🏾 😄

but you can't even install things locally until the dependencies are fixed

But yes, the deps might not be compatible, eg. phpunit in v8.5 had few days ago extends Match in its code so that would crash anyway. Removing them is IMO fine, at least until we stop supporting 7.1.

@mfn
Copy link
Contributor Author

mfn commented Dec 1, 2020

Ok, activated git time travel and we're back to the composer remove approach 😅

@mfn
Copy link
Contributor Author

mfn commented Dec 1, 2020

I'll leave the git mess until we know what solution we want to merge (or not) and I'll clean them up then.

@@ -40,8 +40,16 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Remove dependencies not used in this job for PHP 8 compatibility
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR, none of those dependencies are used anyway in this jobs matrix so the argument could be made we always want to remove them, speeds up composer (no resolving, no installing, no downloading, no caching, etc.).

But otherwise it could be deemed as temporarily solution until the dependency issues can be resolved.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep it as a temporary solution as it would introduce more complexity into CI. As for speed, it's micro optimalization and therefore not significant IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger that!

Copy link
Collaborator

@spawnia spawnia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done

@vladar can we just merge PRs like this?

@vladar
Copy link
Member

vladar commented Dec 10, 2020

@spawnia Feel free to merge any PR when you feel confident enough! I trust you here 👍 In the worst-case, we can always revert.

@spawnia
Copy link
Collaborator

spawnia commented Dec 10, 2020

Thank you @vladar, will do!

@spawnia spawnia changed the title [GHA] Test on PHP 8 Test on PHP 8 Dec 10, 2020
@spawnia spawnia merged commit a7443d1 into webonyx:master Dec 10, 2020
@mfn
Copy link
Contributor Author

mfn commented Dec 10, 2020

Thank you @spawnia , @vladar and @simPod !

@mfn mfn deleted the mfn-gha branch December 10, 2020 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants