-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try running PHP unit tests in multiple PHP versions on github #44566
Conversation
…iable in run command
It looks like this is because there's no 8.2 version of the WordPress image on docker hub - https://hub.docker.com/_/wordpress |
- name: Install WordPress | ||
run: | | ||
npm run wp-env start | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run test:unit:php
already calls npm run wp-env start
, so this is duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, but lint:php
which runs after this doesn't call npm run wp-env start
. I've pushed a commit so that it does.
I personally think it might be better to go the other way and avoid npm run wp-env start
as a prerequisite for these jobs.
Size Change: +36 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
The tests definitely run on PHP 8.1 now as expected, as there are some additional errors coming through: However the job for PHP 7.2 ends up being canceled: Not sure why 🤔 |
Well, the official Docker image from WP itself does have PHP 8.2 available: https://github.com/WordPress/wpdev-docker-images / https://hub.docker.com/u/wordpressdevelop |
Closing in favor of #46510 |
What?
See #43333
wp-env supports specifying the PHP version as an environment variable, so I'm hoping this is all that's required to run PHP unit tests against multiple PHP versions.
Why?
It'll help catch issues like this one - PHP 8.2 | Gutenberg is introducing deprecated callables into WP Core.
One problem is that wp-env doesn't seem to support PHP 8.2, when I tried it from the command line it errors:
How?
Use a matrix for the 'unit-php' job. At the moment I've started with 7.2 and 8.1 as the PHP versions to test that this works.