cicirello / jacoco-badge-generator

Coverage badges, and pull request coverage checks, from JaCoCo reports in GitHub Actions
https://actions.cicirello.org/jacoco-badge-generator/
MIT License
101 stars 42 forks source link

Feature Req: How to use directly without github action? #42

Closed jrichardsz closed 2 years ago

jrichardsz commented 2 years ago

Is your feature request related to a problem? Please describe. Is not related to a problem. Is just the request of a piece of documentation in which you show us how to use it directly without github actions

Describe the solution you'd like Maybe on a direct usage section in readme, you could add something like this:

python3 JacocoBadgeGenerator.py \
/foo/project/target/site/jacoco/jacoco.csv \
badges \
coverage.svg \
branches.svg \
true \
true \
fail \
0.1 \
0.1 \
false \
false \
"10,30,50,70,90,100" \
'#4c1 #97ca00 #a4a61d #dfb317 #fe7d37 #e05d44' \
true \
true \
coverage.json \
branches.json \
true \
summary.json

There were many attempts to figure out the relationship between 12 and 13 args (colors and intervals). Maybe this comments could be improved to highlight that relationship

Describe alternatives you've considered Maybe an extra test on https://github.com/cicirello/jacoco-badge-generator/blob/main/tests/tests.py with this direct usage.

Thanks!

cicirello commented 2 years ago

This is a duplicate of #40. So I'm going to close it in a moment. But first.... Several of the inputs really only make sense within the context of GitHub Actions such as those related to failing workflow runs if coverage decreased, etc. To serve as a proper command line tool outside of Actions, the input handling needs to be done differently, such as how default inputs are handled.

I am planning on refactoring input handling for that purpose although it isn't high priority.

cicirello commented 2 years ago

I forgot to answer your question about the colors and intervals inputs. As an example, consider intervals: 90 75 60 0 and colors: green yellow orange red. If coverage is at least 90 then color is green. Otherwise if coverage is at least 75 then color is yellow. Otherwise if coverage is at least 60 then color is orange. And otherwise it is red.