Skip to content

Commit

Permalink
tweak coveralls config
Browse files Browse the repository at this point in the history
  • Loading branch information
crowesn committed Nov 13, 2023
1 parent 2a4b3e7 commit bc7c6ea
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 58 deletions.
65 changes: 32 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1
orbs:
samvera: samvera/circleci-orb@1
coveralls: coveralls/coveralls@1.0.6
coveralls: coveralls/coveralls@2.2.1

jobs:
build:
Expand Down Expand Up @@ -45,52 +45,51 @@ jobs:
WORKING_PATH: /tmp
UPLOAD_PATH: /tmp
CACHE_PATH: /tmp/cache
COVERALLS_PARALLEL: true
COVERALLS_PARALLEL: "true"

parallelism: 6
parallelism: 12
working_directory: ~/ucrate

steps:
- checkout
- checkout

- samvera/bundle:
ruby_version: << parameters.ruby_version >>
bundler_version: << parameters.bundler_version >>
- samvera/bundle:
ruby_version: << parameters.ruby_version >>
bundler_version: << parameters.bundler_version >>

- samvera/rubocop
- samvera/rubocop

- run:
name: Get yarn version
command: echo $(yarn --version) >> "YARN_VERSION"
- run:
name: Get yarn version
command: echo $(yarn --version) >> "YARN_VERSION"

- run: yarn
- run: yarn

- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn

- save_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}-{{ checksum "YARN_VERSION" }}
paths:
- ~/project/node_modules
- save_cache:
key: v1-yarn-{{ checksum "yarn.lock" }}-{{ checksum "YARN_VERSION" }}
paths:
- ~/project/node_modules

- samvera/install_solr_core

- samvera/parallel_rspec
- samvera/install_solr_core

- samvera/parallel_rspec
- coveralls/upload:
parallel_finished: true
coverage_file: "/home/circleci/ucrate/coverage/lcov/ucrate.lcov"
coverage_format: "lcov"
flag_name: "split-group-$CIRCLE_SPLIT_GROUP"

- store_artifacts:
path: coverage

- coveralls/upload:
parallel_finished: true
path_to_lcov: /home/circleci/ucrate/coverage/lcov/ucrate.lcov


workflows:
version: 2
ci:
jobs:
- build:
name: ruby2-7-8
jobs:
- build:
name: ruby2-7-8
22 changes: 0 additions & 22 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,6 @@ def ci_build?
ENV['TRAVIS'] || ENV['CIRCLE']
end

require 'simplecov'
require 'coveralls'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
)

SimpleCov.start 'rails' do
# Directories to exclude from coverage
add_filter '/.github/'
add_filter '/bin'
add_filter '/coverage/'
add_filter '/db/'
add_filter '/public/'
add_filter '/solr/'
add_filter '/spec/'
add_filter '/tmp/'
add_filter '/vendor/'
end

require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
Expand Down
16 changes: 13 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,21 @@
require 'coveralls'

SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
SimpleCov.start 'rails'

SimpleCov.start 'rails' do
# Directories to exclude from coverage
add_filter '/.github/'
add_filter '/bin'
add_filter '/coverage/'
add_filter '/db/'
add_filter '/public/'
add_filter '/solr/'
add_filter '/spec/'
add_filter '/tmp/'
add_filter '/vendor/'
end

SimpleCov.at_exit do
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
Expand Down

0 comments on commit bc7c6ea

Please sign in to comment.