Closed westy92 closed 2 months ago
This is currently possible by specifying the vendored_phpunit_path
option, but seeing as you're not the first to ask about this, I think there should be a better way.
Here's what I propose: a new value to version
, so you don't specify 10.1
or latest
, but you can specify composer
to get what you want.
Also, I think it makes sense to change the default value for the version
input to composer
. What do you think?
Thanks for the quick response! I think having a default composer
version
option is a great solution.
I agree, I'm amazed I didn't think of this before - not everyone always wants/expects the latest version of these tools.
Thanks for the report. I'll get it into action as soon as I can.
I thought of it because my builds on PHP 8.0 kept falling even though I have PHPUnit 9.x in my config. Then I looked at the logs and saw this was using the latest. For now I'm hardcoding the version to '9' to match my dependency version. Thank you for jumping right into this. Feel free to tag me for PR review.
Just keeping you in the loop on the development of this.
I thought I'd implement on my lesser-used https://github.com/php-actions/phpstan repository to test some real world impacts. There are a few issues already cropping up from people who use non-standard bin directories, different composer configurations, etc. so I'm glad I didn't implement my naive solution too quickly.
I will work through the issues and eventually make a v4
release to this Action.
You could add the option in v3 and make it the default in v4, right? Or maybe never make it the default but make it clear and obvious how and when to use it.
Yep, good idea. Still need to make sure things don't break but I'll add it as an optional change in v3.
This has been implemented in the test branch composer-version--user
. Please read https://github.com/php-actions/phpunit/issues/51#issuecomment-1723958575 for more information on how to test - your feedback is appreciated.
@g105b this works nice for me. Can we expect a release with this fix in the near future?
Yes, I'll make a PR later today. Thank you for testing.
I'm picking this up out of necessity. I ran into this issue here: https://github.com/PhpGt/Dom/pull/454
V4 release made that includes all the latest changes. You can see in PHP.Gt/Dom that the tests are passing nicely. Thanks to everyone here for chipping in :)
Either by default or with a new option, use the PHPUnit version specified in the repo's composer.json/lock file.