Closed osma closed 3 years ago
Hi @osma,
This is great, thanks! I can't see any issue with this really in terms of opening up networks to other things, because if it weren't for needing to run a pre-built PHP image, we would be running PHPUnit within the Action Runner itself anyway.
I will test what you've done in https://github.com/php-actions/example-phpunit to make sure existing tests aren't affected for some reason, but on the whole this looks really positive and I'm very thankful for your input.
Greg.
Thanks for merging @g105b ! Any chance of tagging a new release so that this version can be used with the uses
keyword from other Actions?
Ah, I realized it's possible to use uses
with a specific commit id, so I did this instead:
uses: php-actions/phpunit@91ff02a58932e63741157ea8c04e7e7077233537
Anyway a fresh tagged release (perhaps just moving the v2 tag a little?) would be nice.
Hi @osma ,
I'm planning on making a new release with your changes - there's another improvement I'd like to finish with the PHP build system and then I'll release a v3 soon.
By the way, you can also do uses: php-actions/phpunit@master
or any other branch name.
Cheers, Greg.
This PR adds a
--network host
argument to thedocker run
command that executes PHPUnit within its own container. This way, the container is not bound to the default bridge network (where it is in practice isolated from other containers and the host system in terms of networking) but instead stays on the host network. It can access services running on the host (e.g. a MySQL daemon). If service containers are used, they can also be accessed as long as their ports are exposed to the host machine using aports
declaration.See #28 for some background.
I've tested this using my own fork osma/phpunit and it works in my case (accessing a Fuseki service on the host machine). If you want to try it out you can use it like this:
Fixes #28 Fixes #26 (probably)