Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP tweak coveralls config #1115

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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