/simplecov-shields-badge

Simplecov shileds.io badge formatter

Primary LanguageRubyApache License 2.0Apache-2.0

simplecov-shields-badge

Build Status Coverage

A simplecov formatter that generates a shields.io badge and uploads to gh-pages

Examples

Coverage 20% Coverage 40% Coverage 60% Coverage 80% Coverage 90% Coverage 100%

Usage

Add to your Gemfile

group :test do
  gem 'simplecov-shields-badge', require: false
end

Add to your README.md

 [![Coverage](https://USERNAME.github.io/REPO/badge.svg)](https://github.com/USERNAME/REPO)

Add to the top of your tests/helper.rb file

require 'simplecov'
SimpleCov.start

require 'shields_badge'
SimpleCov.formatter = SimpleCov::Formatter::ShieldsBadge

In your CI Environment Variables

GITHUB_USER="a github username"
GITHUB_MAIL="github user email"
GITHUB_ORG="github organization or username"
GITHUB_REPO="github repo name"
GITHUB_ACCESS_TOKEN="github access token with commit permission"