-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Introduce tests, namespacing, precision rounding and optional exiting #7
Conversation
15c2cd8
to
2ff0944
Compare
@emibcn can you confirm that the way rounding is implemented here is good for you? And will this be a breaking change for you? If not, I will tag this as |
1642b14
to
d055e10
Compare
Wow!! Wasn't expecting such a change! Great! About de precision: The method to get the rounded number looks goodI think it's better to have 2 outputs: one with all the decimals (for calculations) and another rounded (for pretty printing). About the About the Dockerfile: I think it will be easier to you to use the PHP file I have been looking for a library to create GitHub Actions with PHP like the ones in JS (so you can get the
This is not a breaking change to me. The amount of lines and the approach have changed both a lot, maybe this is enough to re-tag? I don't know, it's up to you. |
Thanks for the feedback @emibcn ! I'll try to release this tomorrow or in the weekend with your added suggestions as a v2 release. The main reason for the exit option was to allow me to test things with PHPUnit and not having the script actually exit. But a failed boolean output is a great added feature. I tried using a shebang and using the php file as an entrypoint, but ended up getting php errors because of the new namespacing. I'd rather have the new namespaced setup and having to declare duplicate inputs vs the old setup. But feel free to try and help me to find a solution 😄 |
Thank you for the job!
Great!
Fine!
Did a pull request over your branch. After re-creating the Docker image, it works: $ cat Dockerfile
FROM php:7.4-alpine
COPY src /src
ENTRYPOINT ["/src/test-coverage-checker.php"]
$ docker build . --tag gha:latest
Sending build context to Docker daemon 402.9kB
Step 1/3 : FROM php:7.4-alpine
---> 13b8fc557e7d
Step 2/3 : COPY src /src
---> 96a3f8b5e70e
Step 3/3 : ENTRYPOINT ["/src/test-coverage-checker.php"]
---> Running in cee988e16801
Removing intermediate container cee988e16801
---> cd1b7d411c97
Successfully built cd1b7d411c97
Successfully tagged gha:latest
# Here, the volume is used to contain the XML file
$ docker run --volume $PWD/v:/v:ro gha:latest /v/clover.xml 40 2 true ; echo $?
[ERROR] Code coverage is 38.99%, which is not accepted (>=40%)
##[set-output name=coverage;]38.99
1 |
Ahhh, ok, now I see the workflow output. Ok, let's try another solution. |
… exit status correctly (and avoid one extra process)
Ok, now I've changed the entrypoint to pass all arguments, independently of how many are there, and use |
Remove `entrypoint.sh` and use PHP script as Docker's entrypoint
Thank you for the entrypoint polish, it's a lot better now! And I am also finished now. I made all changes fully backward-compatible so I'll just release it on Please check the README for all the new input and output options. I tried to keep it extreme flexible, so people can just use what and how they want. |
This is a great job!! Going to update all the workflows where I use it ;) |
Adds:
And cleans the code up a lot.
Fixes #6 and #5