Skip to content

Commit

Permalink
Do things differently for coveralls and code climate
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzedge committed May 9, 2023
1 parent b13c00e commit da68673
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ruby.yml
Expand Up @@ -70,10 +70,13 @@ jobs:
with:
ruby-version: 3.2.2
bundler-cache: true
- name: Report rspec test coverage to coveralls.io and codeclimate.com
- name: Report rspec test coverage to coveralls.io
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: bundle exec rspec
- name: Report rspec test coverage to codeclimate.com
uses: paambaati/codeclimate-action@v4.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
coverageCommand: bundle exec rspec
20 changes: 13 additions & 7 deletions spec/spec_helper.rb
@@ -1,15 +1,21 @@
# frozen_string_literal: true

require 'yaml'
require 'simplecov'
require 'coveralls'

SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter,
]
if ENV.has_key? 'COVERALLS_REPO_TOKEN'
require 'coveralls'

Coveralls.wear! do
add_filter '/spec/'
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter,
]

Coveralls.wear! do
add_filter '/spec/'
end
else
SimpleCov.start
end

require 'rspec'
Expand Down

0 comments on commit da68673

Please sign in to comment.