mikemaccana
mikemaccana

Reputation: 123178

How do show my tests passing/failing in Github?

I have a project on github that has extensive unit tests (using mocha for node.js).

I'd like to show off by showing those tests passing/failing on each page. I notice other projects on Github are doing this.

enter image description here

I've been unable to find any documentation on how to make the test status display.

Upvotes: 97

Views: 35391

Answers (4)

Florian
Florian

Reputation: 170

GitHub also has workflow status badges for GitHub Actions.

The image is usually embedded into the README.md file using Markdown like this:

![example workflow](https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW>.yml/badge.svg)

Upvotes: 5

relekang
relekang

Reputation: 1884

Take a look at Travis CI. You can use it with GitHub.

They have docs on using NodeJS

Those badges you see are called "status images" and Travis provides MarkDown that you can insert into your project's README.md file.

Upvotes: 55

mjhm
mjhm

Reputation: 16695

CircleCI the status badges are also simply images that you can drop into your README.md file with the markdown. For example:

![Build Status](https://circleci.com/gh/<your github name>/<repo name>.png?circle-token=:circle-token)

or

![Build Status](https://circleci.com/gh/<your github name>/<repo name>.svg?style=shield&circle-token=:circle-token)

Upvotes: 7

VonC
VonC

Reputation: 1324043

Note that since April 26th 2013, you can see the build status on your GitHub repo branch page:

build status on GitHub repo branches

The Commit Status API allows you to use that elsewhere: see " Repo Statuses API".

Starting April 30th, 2013, the API endpoint for commit statuses has been extended to allow branch and tag names, as well as commit SHAs.

Upvotes: 13

Related Questions