This article is about Codeship Basic.

Integrating Codeship With Coveralls for Code Coverage Reports

Estimated Reading Time: 1 min

Coveralls Discount Code

Thanks to our partnership with Coveralls we can provide a 25% Discount for 3 months. Use the code “coverallslovescodeship” and get started right away.

Setup for Ruby Project

Starting with Coveralls and Codeship is easy. Their docs do a great job of guiding you, but all there is to set up your Ruby app is add a .coveralls.yml file to your codebase that contains your Coveralls key:


It is also possible to set this in the Environment setting of your Codeship project


then simply require the Gem in your Gemfile

gem 'coveralls', require: false

and put the initializers into your spec_helper.rb or env.rb depending on which framework you use

require 'coveralls'

If you want to combine the coverage data from different frameworks, add the following to your spec_helper.rb and env.rb (also take a look at Coveralls Docs – mentioned above – on that topic).

# Coveralls with Rspec and Cucumber
require 'coveralls'
SimpleCov.merge_timeout 3600

SimpleCov.command_name "RSpec/Cucumber:#{}#{ENV['TEST_ENV_NUMBER']}"

Then you need to add a rake task that pushes your coverage report as soon as your build is finished.

require 'coveralls/rake/task'

To push the data to Coveralls, add the following after your test commands on Codeship:

bundle exec rake coveralls:push

Setup for other languages

Coveralls supports a lot of other languages. Check out their fantastic documentation.

Need More Help?

Get in touch if you need more help, or post on Stack Overflow using the tag #Codeship.

  • Ask The Helpdesk A Question
  • Code Examples And Sample Projects
    • Was This Article Helpful?