Skip to content

Generate Buildkite annotations from your SimpleCov coverage reports when running your build on Buildkite

License

Notifications You must be signed in to change notification settings

stevedev/simplecov-buildkite

 
 

Repository files navigation

SimpleCov::Buildkite

Gem Version Build Status

Generate Buildkite annotations from your SimpleCov coverage reports when running your build on Buildkite.

Installation

Add this line to your application's Gemfile, after simplecov:

gem "simplecov"
gem "simplecov-buildkite"

And then execute:

$ bundle

Or install it yourself as:

$ gem install simplecov-buildkite

Usage

Use it alongside your favourite formatter. For example, in Rails with RSpec, add it in your spec_helper.rb like this:

# spec/spec_helper.rb

require "simplecov"
require "simplecov-buildkite"

SimpleCov.start "rails" do
  load_profile "buildkite"

  formatter SimpleCov::Formatter::MultiFormatter.new([
    SimpleCov::Formatter::HTMLFormatter,
    SimpleCov::Buildkite::AnnotationFormatter,
  ])
end

When run on Buildkite with the "buildkite" profile enabled, this will also output a pretty Buildkite annotation, with coverage change breakdowns for the current PR or branch and commit:

Buildkite build showing a SimpleCov report in a Buildkite annotation

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ticky/simplecov-buildkite. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the SimpleCov::Buildkite project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

Generate Buildkite annotations from your SimpleCov coverage reports when running your build on Buildkite

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 98.9%
  • Shell 1.1%