From df9286ee7472b3684257b706efbe3d0b0c9f9339 Mon Sep 17 00:00:00 2001 From: Noah Botimer Date: Fri, 2 Aug 2019 19:23:49 -0400 Subject: [PATCH 1/3] Update CircleCI Ruby and Rails versions This gem had a particularly verbose config. This attempts to trim it down and normalize with other gems that use engine_cart. Re: samvera/maintenance#20 Re: samvera/maintenance#21 --- .circleci/config.yml | 185 +++++++++---------------------------------- .gitignore | 1 + 2 files changed, 37 insertions(+), 149 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a0e8ac..c3855ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,94 +3,47 @@ version: 2.1 orbs: samvera: samvera/circleci-orb@0 jobs: - bundle: + bundle_lint_test: parameters: ruby_version: type: string - default: 2.6.3 bundler_version: type: string default: 1.17.3 rails_version: type: string - default: '5.2.3' executor: - name: 'samvera/ruby' + name: 'samvera/ruby_fcrepo_solr' ruby_version: << parameters.ruby_version >> + working_directory: ~/project environment: + ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-coffee --skip-puma --skip-test RAILS_VERSION: << parameters.rails_version >> NOKOGIRI_USE_SYSTEM_LIBRARIES: true + CC_TEST_REPORTER_ID: e52010675d2774ee408c14c0de08c143d0749e59beb6dd729254d1b3ea94c7b1 steps: - samvera/cached_checkout + - samvera/bundle_for_gem: ruby_version: << parameters.ruby_version >> bundler_version: << parameters.bundler_version >> project: hydra-editor - - persist_to_workspace: - root: ~/ - paths: - - project/* - - project/**/* - build: - parameters: - ruby_version: - type: string - default: 2.6.3 - bundler_version: - type: string - default: 1.17.3 - rails_version: - type: string - default: '5.2.3' - executor: - name: 'samvera/ruby' - ruby_version: << parameters.ruby_version >> - environment: - RAILS_VERSION: << parameters.rails_version >> - NOKOGIRI_USE_SYSTEM_LIBRARIES: true - ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test - steps: - - attach_workspace: - at: ~/ - - samvera/engine_cart_generate: - cache_key: v1-internal-test-app-{{ checksum "hydra-editor.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-<< parameters.rails_version >>-<< parameters.ruby_version >> - - samvera/bundle_for_gem: - ruby_version: << parameters.ruby_version >> - bundler_version: << parameters.bundler_version >> - project: hydra-editor - - persist_to_workspace: - root: ~/ - paths: - - project/* - - project/**/* - test: - parameters: - ruby_version: - type: string - default: 2.6.3 - bundler_version: - type: string - default: 1.17.3 - executor: - name: 'samvera/ruby_fcrepo_solr' - ruby_version: << parameters.ruby_version >> - environment: - CC_TEST_REPORTER_ID: e52010675d2774ee408c14c0de08c143d0749e59beb6dd729254d1b3ea94c7b1 - steps: - - attach_workspace: - at: ~/ - run: name: "Download the Code Climate reporter" command: | curl -L "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - - samvera/install_solr_core: - solr_config_path: .internal_test_app/solr/config + + - samvera/engine_cart_generate: + cache_key: v5-internal-test-app-{{ checksum "hydra-editor.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-<< parameters.rails_version >>-<< parameters.ruby_version >> + - samvera/bundle_for_gem: ruby_version: << parameters.ruby_version >> bundler_version: << parameters.bundler_version >> project: hydra-editor + + - samvera/rubocop - samvera/parallel_rspec - run: name: "Submit the exit code to Code Climate" @@ -100,93 +53,27 @@ workflows: version: 2 ci: jobs: - - bundle: - name: "bundle_ruby2-6_rails5-2" - ruby_version: "2.6.3" - rails_version: "5.2.3" - - build: - name: "build_ruby2-6_rails5-2" - ruby_version: "2.6.3" - rails_version: "5.2.3" - requires: - - bundle_ruby2-6_rails5-2 - - test: - name: "ruby2-6_rails5-2" - ruby_version: "2.6.3" - requires: - - build_ruby2-6_rails5-2 - - bundle: - name: "bundle_ruby2-6_rails5-1" - ruby_version: "2.6.3" - rails_version: "5.1.7" - - build: - name: "build_ruby2-6_rails5-1" - ruby_version: "2.6.3" - rails_version: "5.1.7" - requires: - - bundle_ruby2-6_rails5-1 - - test: - name: "ruby2-6_rails5-1" - ruby_version: "2.6.3" - requires: - - build_ruby2-6_rails5-1 - - bundle: - name: "bundle_ruby2-5_rails5-2" - ruby_version: "2.5.5" - rails_version: "5.2.3" - - build: - name: "build_ruby2-5_rails5-2" - ruby_version: "2.5.5" - rails_version: "5.2.3" - requires: - - bundle_ruby2-5_rails5-2 - - test: - name: "ruby2-5_rails5-2" - ruby_version: "2.5.5" - requires: - - build_ruby2-5_rails5-2 - - bundle: - name: "bundle_ruby2-5_rails5-1" - ruby_version: "2.5.5" - rails_version: "5.1.7" - - build: - name: "build_ruby2-5_rails5-1" - ruby_version: "2.5.5" - rails_version: "5.1.7" - requires: - - bundle_ruby2-5_rails5-1 - - test: - name: "ruby2-5_rails5-1" - ruby_version: "2.5.5" - requires: - - build_ruby2-5_rails5-1 - - bundle: - name: "bundle_ruby2-4_rails5-2" - ruby_version: "2.4.6" - rails_version: "5.2.3" - - build: - name: "build_ruby2-4_rails5-2" - ruby_version: "2.4.6" - rails_version: "5.2.3" - requires: - - bundle_ruby2-4_rails5-2 - - test: - name: "ruby2-4_rails5-2" - ruby_version: "2.4.6" - requires: - - build_ruby2-4_rails5-2 - - bundle: - name: "bundle_ruby2-4_rails5-1" - ruby_version: "2.4.6" - rails_version: "5.1.7" - - build: - name: "build_ruby2-4_rails5-1" - ruby_version: "2.4.6" - rails_version: "5.1.7" - requires: - - bundle_ruby2-4_rails5-1 - - test: - name: "ruby2-4_rails5-1" - ruby_version: "2.4.6" - requires: - - build_ruby2-4_rails5-1 + - bundle_lint_test: + name: bundle_ruby2-6_rails5-2 + ruby_version: 2.6.3 + rails_version: 5.2.3 + - bundle_lint_test: + name: bundle_ruby2-6_rails5-1 + ruby_version: 2.6.3 + rails_version: 5.1.7 + - bundle_lint_test: + name: bundle_ruby2-5_rails5-2 + ruby_version: 2.5.5 + rails_version: 5.2.3 + - bundle_lint_test: + name: bundle_ruby2-5_rails5-1 + ruby_version: 2.5.5 + rails_version: 5.1.7 + - bundle_lint_test: + name: bundle_ruby2-4_rails5-2 + ruby_version: 2.4.6 + rails_version: 5.2.3 + - bundle_lint_test: + name: bundle_ruby2-4_rails5-1 + ruby_version: 2.4.6 + rails_version: 5.1.7 diff --git a/.gitignore b/.gitignore index 1724f0a..c5daa25 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ fcrepo4-data/ fcrepo4-test-data/ jetty/ tmp/ +coverage/ From 33cec8baf6aa7f508240da106fca6ad7fa8a556a Mon Sep 17 00:00:00 2001 From: GriffinJ Date: Fri, 2 Aug 2019 20:46:45 -0400 Subject: [PATCH 2/3] Removing the "working directory" CircleCI configuration step; Ensuring that "bundle install" is run before and after the internal test app. is generated; Fixing the Rubocop configuration --- .circleci/config.yml | 13 +++++++------ .rubocop.yml | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3855ed..727f40e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,6 @@ jobs: executor: name: 'samvera/ruby_fcrepo_solr' ruby_version: << parameters.ruby_version >> - working_directory: ~/project environment: ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-coffee --skip-puma --skip-test RAILS_VERSION: << parameters.rails_version >> @@ -23,7 +22,6 @@ jobs: CC_TEST_REPORTER_ID: e52010675d2774ee408c14c0de08c143d0749e59beb6dd729254d1b3ea94c7b1 steps: - samvera/cached_checkout - - samvera/bundle_for_gem: ruby_version: << parameters.ruby_version >> bundler_version: << parameters.bundler_version >> @@ -34,15 +32,18 @@ jobs: curl -L "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - + - samvera/bundle_for_gem: + ruby_version: << parameters.ruby_version >> + bundler_version: << parameters.bundler_version >> + project: hydra-editor - samvera/engine_cart_generate: - cache_key: v5-internal-test-app-{{ checksum "hydra-editor.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-<< parameters.rails_version >>-<< parameters.ruby_version >> - + cache_key: v1-internal-test-app-{{ checksum "hydra-editor.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-<< parameters.rails_version >>-<< parameters.ruby_version >> + - samvera/install_solr_core: + solr_config_path: .internal_test_app/solr/config - samvera/bundle_for_gem: ruby_version: << parameters.ruby_version >> bundler_version: << parameters.bundler_version >> project: hydra-editor - - samvera/rubocop - samvera/parallel_rspec - run: diff --git a/.rubocop.yml b/.rubocop.yml index 4d89ea7..4267899 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,6 +11,7 @@ AllCops: - 'db/**/*' - 'script/**/*' - 'spec/test_app_templates/**/*' + - 'vendor/bundle/**/*' Bundler/DuplicatedGem: Exclude: From 913e5cce7f555c63875e79ac54476dd0de5c40cc Mon Sep 17 00:00:00 2001 From: GriffinJ Date: Sat, 3 Aug 2019 09:42:23 -0400 Subject: [PATCH 3/3] Removing a redundant samvera/bundle_for_gem step --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 727f40e..dda5449 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,10 +32,6 @@ jobs: curl -L "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - - samvera/bundle_for_gem: - ruby_version: << parameters.ruby_version >> - bundler_version: << parameters.bundler_version >> - project: hydra-editor - samvera/engine_cart_generate: cache_key: v1-internal-test-app-{{ checksum "hydra-editor.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-<< parameters.rails_version >>-<< parameters.ruby_version >> - samvera/install_solr_core: