From b478597eaf3a1b8d4ad1649ba8d48a73a331ee2c Mon Sep 17 00:00:00 2001 From: Frank Nowinski Date: Tue, 22 Oct 2024 15:06:09 -0400 Subject: [PATCH] add codecov and remove codeclimate --- .circleci/config.yml | 44 ++++++-------------------------------------- active_force.gemspec | 3 ++- spec/spec_helper.rb | 3 +++ 3 files changed, 11 insertions(+), 39 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ef9cc23..d73fcf2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,7 @@ -version: 2 +version: 2.1 + +orbs: + codecov: codecov/codecov@4.0.1 references: default_docker_ruby_executor: &default_docker_ruby_executor @@ -51,11 +54,6 @@ jobs: key: active_force-{{ checksum "active_force.gemspec" }} paths: - ~/active_force/active_force_index/vendor/bundle - - run: - name: Install Code Climate Test Reporter - command: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - run: name: Run RSpec command: | @@ -63,37 +61,10 @@ jobs: ./cc-test-reporter before-build TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) bundle exec rspec $TESTFILES --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress - - run: - name: Code Climate Test Coverage - command: | - ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json" - - persist_to_workspace: - root: coverage - paths: - - codeclimate.*.json - - store_test_results: - path: /tmp/test-results - - store_artifacts: - path: /tmp/test-results - destination: test-results + - codecov/upload - store_artifacts: path: coverage - upload-coverage: - working_directory: ~/active_force/active_force_index - docker: - - *default_docker_ruby_executor - steps: - - attach_workspace: - at: ~/active_force/active_force_index - - run: - name: Install Code Climate Test Reporter - command: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - - run: - name: Combine and Upload Coverage - command: | - ./cc-test-reporter sum-coverage --output - codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input - + workflows: version: 2 build_and_test: @@ -102,6 +73,3 @@ workflows: - rspec-test: requires: - build - - upload-coverage: - requires: - - rspec-test diff --git a/active_force.gemspec b/active_force.gemspec index 5b508ac..5b6fb32 100644 --- a/active_force.gemspec +++ b/active_force.gemspec @@ -32,5 +32,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec', '>= 0' spec.add_development_dependency 'rspec_junit_formatter' spec.add_development_dependency 'pry', '>= 0' - spec.add_development_dependency 'simplecov', '>= 0' + spec.add_development_dependency 'simplecov' + spec.add_development_dependency 'simplecov-cobertura' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 997def4..2208e6f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,10 @@ require 'simplecov' +require 'simplecov-cobertura' SimpleCov.start do add_filter '/vendor' add_filter '/spec' + + formatter SimpleCov::Formatter::CoberturaFormatter end $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)