Skip to content

Commit

Permalink
add codecov and remove codeclimate
Browse files Browse the repository at this point in the history
  • Loading branch information
franknowinski committed Oct 22, 2024
1 parent f24c3ec commit b478597
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 39 deletions.
44 changes: 6 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: 2
version: 2.1

orbs:
codecov: codecov/[email protected]

references:
default_docker_ruby_executor: &default_docker_ruby_executor
Expand Down Expand Up @@ -51,49 +54,17 @@ 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: |
mkdir /tmp/test-results
./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:
Expand All @@ -102,6 +73,3 @@ workflows:
- rspec-test:
requires:
- build
- upload-coverage:
requires:
- rspec-test
3 changes: 2 additions & 1 deletion active_force.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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__)
Expand Down

0 comments on commit b478597

Please sign in to comment.