Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display Codecov.io badge in GitHub README.md?

Tags:

As mentioned in the title, how can I add a Codecov.io badge resembling the coverage of my project?

There is nothing stated about this in the Docs from Codecov.io.

Thanks in advance.

like image 215
Chgad Avatar asked Jan 02 '19 17:01

Chgad


4 Answers

Go to https://codecov.io/gh/<your-organisation>/<your-project>/settings/badge, here you can see your badges ready to be copied.

Or just navigate to your project and go to Settings -> Badge.

like image 87
harvzor Avatar answered Oct 03 '22 02:10

harvzor


Step-by-step guide to get your Codecov.io badge:

  1. Go to Settings section

Settings

  1. Click Badge section

Badge

  1. Click Copy under Markdown section

enter image description here

like image 40
Jerry Chong Avatar answered Oct 03 '22 00:10

Jerry Chong


After a long search and Try-n-Error i was able to find something which implicitly helped finding it out.

The way to implement a Codecov.io badge with your current Coverage ist the following :

In HTML :

<a href="https://codecov.io/github/<Your Organization/Acc.>/
<YourRepo>?branch=master">
<img alt="Coverage" src="https://codecov.io
/github/<Your Organization/Acc.>/<YourRepo>/coverage.svg?branch=master">
</a>

In Markdown:

[![codecov.io](https://codecov.io/github/<Your Organization/Acc.>/<YourRepo>/coverage.svg?branch=master)]
(https://codecov.io/github/<Your Organization/Acc.>/<YourRepo>?branch=master)

This Solution expects that you host the project on Github and that you upload the coverage reports.

like image 42
Chgad Avatar answered Oct 03 '22 00:10

Chgad


Navigate to https://app.codecov.io/gh/your_organization/your_repository/settings/badge (replace the placeholders in the link) and copy the code they show you there (there's HTML, markdown and RST). You need to get it from there because there's a unique access token for it.

like image 33
Roger Oba Avatar answered Oct 03 '22 01:10

Roger Oba