Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github actions and badges show percentage data

I have read about the way to create and add a custom workflow badge which will show whether the workflow passes or fails. But here's a question. Is it possible to output some percentage data on the badge and how to output this data?

like image 956
arsdever Avatar asked Sep 19 '19 19:09

arsdever


People also ask

How do I show my badge on GitHub?

How do I display the current status of the last run of an Action? Lucky me, this one is an easy one. On the Actions section in GitHub, we select the workflow and we have the option to “Create Status Badge”.

How do GitHub badges work?

A status badge shows whether a workflow is currently failing or passing. A common place to add a status badge is in the README.md file of your repository, but you can add it to any web page you'd like. By default, badges display the status of your default branch.

How do I get a code coverage badge?

To obtain your Codacy badge, open your repository Settings, tab General, select the markup language, and copy the generated code to your README file. You can also add a badge for your coverage if you have set up code coverage for your repository.


1 Answers

At the time of writing, there is no badge provided by github to show amount of code coverage, which is the most popular percentage-showing badge. Other CI/CD frameworks usually provide such a badge, most notably and comparably gitlab, and it is very likely that something like that will arrive at some point in the ongoing github actions beta.

If you can't wait that long, one other option you have is to use an external badge service. A very popular one that contains a wide range of coverage badges is shields.io, they might already support the toolchain you're using.

If that is not the case, you can also request a github actions coverage badge from them or even implement it yourself.

like image 61
Arne Avatar answered Sep 27 '22 21:09

Arne