Skip to content

Commit

Permalink
Merge pull request #38 from collectiveidea/add-simplecov-and-code-cli…
Browse files Browse the repository at this point in the history
…mate

Add simplecov dev dependency and integrate Code Climate
  • Loading branch information
darronschall authored May 24, 2024
2 parents aae22e5 + 67f478a commit 04013d2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:

jobs:
build:
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERAGE: true

runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
Expand All @@ -27,5 +31,16 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cache-version: 1

- name: Setup Code Climate Test Reporter
run: |
sudo curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
sudo chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run RSpec
run: bundle exec rake spec

- name: Coverage Report
run: |
./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
1 change: 1 addition & 0 deletions protoc-gen-twirp_ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rspec-file_fixtures"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "standard"

# For more information and examples about making a new gem, check out our
Expand Down
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# frozen_string_literal: true

if %w[t true yes y 1].include?(ENV["COVERAGE"])
require "simplecov"
SimpleCov.start do
enable_coverage :branch
end
end

require "rspec/file_fixtures"
require "twirp/protoc_plugin"
require "support/matchers/be_empty_scaffolding_matcher"
Expand Down

0 comments on commit 04013d2

Please sign in to comment.