Skip to content

Commit

Permalink
Merge pull request #1126 from stripe/anniel-coveralls
Browse files Browse the repository at this point in the history
Add test coverage using Coveralls
  • Loading branch information
anniel-stripe authored Aug 24, 2022
2 parents 78863b4 + 4d87c3a commit af6fb06
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5
- name: test
run: bundle install && bundle exec rake test
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_SERVICE_NAME: github-action

publish:
name: Publish
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source "https://rubygems.org"
gemspec

group :development do
gem "coveralls_reborn", "~> 0.25.0" if RUBY_VERSION >= "3.1"
gem "mocha", "~> 0.13.2"
gem "rack", ">= 2.0.6"
gem "rake"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Gem Version](https://badge.fury.io/rb/stripe.svg)](https://badge.fury.io/rb/stripe)
[![Build Status](https://github.com/stripe/stripe-ruby/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-ruby/actions?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-ruby/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-ruby?branch=master)

The Stripe Ruby library provides convenient access to the Stripe API from
applications written in the Ruby language. It includes a pre-defined set of
Expand Down
8 changes: 8 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# frozen_string_literal: true

# Report test coverage to coveralls for only one Ruby version to avoid
# repeated builds. This also accounts for coveralls_reborn requiring
# RUBY_VERSION >= 2.5.
if RUBY_VERSION.start_with?("3.1.")
require "coveralls"
Coveralls.wear!
end

require "stripe"
require "test/unit"
require "mocha/setup"
Expand Down

0 comments on commit af6fb06

Please sign in to comment.