Generate Buildkite annotations from your SimpleCov coverage reports when running your build on Buildkite.
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
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:
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.
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.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the SimpleCov::Buildkite project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.