cicirello/jacoco-badge-generator

Feature Req: Add documentation to execute without github actions or docker

jrichardsz opened this issue · 2 comments

Is not an issue. Is just the requirement to generate the badge images without github actions

Describe the solution you'd like
Just a couple of lines showing how to run the python code to generate the images

Describe alternatives you've considered
I reviewed the tests and with some intuition I created this sentence:

python JacocoBadgeGenerator.py jacoco.csv /home coverage.png branch.png true true fail 50 50 true true '100, 90, 80, 70, 60, 0' "#ffffff" true true 50 50 true summary.txt

Also it would be appreciated a markdown table in the readme explaining the parameters.

Can I make you a PR to your readme?

I believe that it should probably run outside of the Actions framework as a command line utility, provided the user has Python installed. However, it wouldn't be particularly pretty. Within GitHub Actions, passing the inputs to the Python program is handled by GitHub Actions, and defined in the actions.yml file. The default values for those parameters are also maintained in that file. As a GitHub Action, if you want to use default input values, you just leave out the relevant input. If you use it instead as a command line utility, you'd need to pass all inputs regardless of whether you just want the defaults. The Python program itself doesn't know about the defaults. GitHub Actions explicitly passes those to it.

Additionally, the inputs are passed in a specific order. You can find the order at the very bottom of the actions.yml file. That is the order that the Python program expects them. If this was deliberately designed to be a command line utility, the parameters would be handled differently than they are now.

Section Inputs of the README has all of the details of the parameters. Some of the docs of some of them are too verbose to fit in a table. But that section documents them all. It is not in the order that they are passed to the Python program since users of the action within GitHub Actions only need to know their names and what they do.

If you are interested in documenting how to use it as a command line utility, perhaps a separate markdown file at top level of repo with a link to it from the main readme. If regular use as a command line utility outside of Actions is anticipated, then a shell script wrapping the Python program to streamline parameter passing for command line users might be beneficial, but that can come later.

@jrichardsz If you are still looking for this, the latest release (2.7.0) now supports running in a CLI mode outside of GitHub Actions. See the updated README for details on installing from PyPI, and for the details on all of the available command-line options. All of the command line options have default values, so you only need to specify if you want to change something. This is much better than trying to use the old version where all options had to be passed in order.