Skip to content

Commit

Permalink
Merge test coverage data for different versions (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
balvig authored Dec 26, 2021
1 parent e9274c2 commit 471dd1f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ version: 2.1
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
ruby: circleci/ruby@0.1.2
coveralls: coveralls/coveralls@1.0.6
node: circleci/node@5.0.0

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
Expand All @@ -21,6 +23,7 @@ jobs:
executor: ruby/default
environment:
RAILS_TEST_VERSION: << parameters.rails_version >>
EUID: 0 # not sure why this is needed, but sudo npm fails
steps:
- checkout
- run:
Expand All @@ -33,27 +36,43 @@ jobs:
- run:
name: Run tests
command: bundle exec rake
- node/install:
node-version: 10.0.0
- coveralls/upload:
parallel: true
coverage:
docker:
- image: circleci/node:10.0.0
steps:
- coveralls/upload:
parallel_finished: true

workflows:
tests:
jobs:
- build:
matrix:
alias: Rails 4
parameters:
rails_version: ["~> 4.0"]
ruby_version: ["2.6.6"]
- build:
matrix:
alias: Rails 5
parameters:
rails_version: ["~> 5.0"]
ruby_version: ["2.6.6", "2.7.2"]
- build:
matrix:
alias: Rails 6
parameters:
rails_version: ["~> 6.0"]
ruby_version: ["2.6.6", "2.7.2", "3.0.0"]
- build:
matrix:
alias: Rails 7
parameters:
rails_version: ["~> 7.0"]
ruby_version: ["2.7.2", "3.0.0"]
- coverage:
requires: ["Rails 4", "Rails 5", "Rails 6", "Rails 7"]
3 changes: 2 additions & 1 deletion spyke.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'actionpack', ENV.fetch('RAILS_TEST_VERSION', '>= 4.0.0')
spec.add_development_dependency 'bundler', '>= 1.6'
spec.add_development_dependency 'coveralls_reborn', '~> 0.23.0'
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'minitest-line'
spec.add_development_dependency 'minitest-reporters'
spec.add_development_dependency 'mocha'
spec.add_development_dependency 'multi_json'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'simplecov-lcov'
spec.add_development_dependency 'webmock'
end
11 changes: 7 additions & 4 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Coverage
require 'coveralls'
Coveralls.wear!
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
require 'simplecov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = 'coverage/lcov.info'
end
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
SimpleCov.start do
add_filter 'test'
end
Expand Down

0 comments on commit 471dd1f

Please sign in to comment.