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

Remove Ruby 2.7 support #270

Merged
merged 2 commits into from
Aug 31, 2023
Merged
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
114 changes: 16 additions & 98 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,18 @@ defaults: &defaults
BUNDLE_PATH: ~/spree/vendor/bundle
RAILS_VERSION: '~> 7.0'
working_directory: ~/spree
docker:
- image: &ruby_2_7_image circleci/ruby:2.7-node-browsers
- image: &redis_image circleci/redis:6.2-alpine

defaults_3_0: &defaults_3_0
<<: *defaults
docker:
- image: &ruby_3_0_image circleci/ruby:3.0-node-browsers
- image: *redis_image
- image: &redis_image circleci/redis:6.2-alpine

defaults_3_2: &defaults_3_2
<<: *defaults
docker:
- image: &ruby_3_2_image cimg/ruby:3.2.0-browsers
- image: *redis_image

run_tests_2_7: &run_tests_2_7
<<: *defaults
parallelism: 8
steps:
- checkout
- restore_cache:
keys:
- spree-dashboard-bundle-v10-ruby-2-7-{{ .Branch }}
- spree-dashboard-bundle-v10-ruby-2-7
- run:
name: Add keyserver
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
- run:
name: Install libvips
command: sudo apt-get update && sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
- run:
name: Ensure bundle Install
command: |
bundle check || bundle install
- run:
name: Create test app
command: |
bundle exec rake test_app
- run:
name: Unlink NPM package
command: |
cd spec/dummy && yarn unlink @spree/dashboard
- run:
name: Run Rspec
command: |
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
bundle exec rspec --format documentation \
--format RspecJunitFormatter \
-o ~/rspec/rspec.xml \
-- ${TESTFILES}
- store_test_results:
path: ~/rspec
- store_artifacts:
path: /tmp/test-artifacts

run_tests_3_0: &run_tests_3_0
<<: *defaults_3_0
<<: *defaults
parallelism: 8
steps:
- checkout
Expand Down Expand Up @@ -152,34 +103,8 @@ run_tests_3_2: &run_tests_3_2
path: /tmp/test-artifacts

jobs:
bundle_ruby_2_7:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- spree-dashboard-bundle-v10-ruby-2-7-{{ .Branch }}
- spree-dashboard-bundle-v10-ruby-2-7
- run:
name: Add keyserver
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
- run:
name: Install libvips
command: sudo apt-get update && sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
- run:
name: Bundle Install
command: |
bundle check || bundle install
- save_cache:
paths:
- vendor/bundle
key: spree-dashboard-bundle-v10-ruby-2-7-{{ checksum "Gemfile.lock" }}

bundle_ruby_3_0:
<<: *defaults_3_0
<<: *defaults
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -227,40 +152,34 @@ jobs:
- vendor/bundle
key: spree-dashboard-bundle-v10-ruby-3-2-{{ checksum "Gemfile.lock" }}

tests_ruby_2_7_rails_7_0_postgres:
<<: *run_tests_2_7
environment: &postgres_environment
tests_ruby_3_0_rails_7_0_postgres:
<<: *run_tests_3_0
environment:
<<: *environment
DB: postgres
DB_HOST: localhost
DB_USERNAME: postgres
docker:
- image: *ruby_2_7_image
- image: *redis_image
- image: *ruby_3_0_image
- image: &postgres_image circleci/postgres:12-alpine
environment:
POSTGRES_USER: postgres

tests_ruby_3_0_rails_7_0_postgres:
<<: *run_tests_3_0
environment:
<<: *postgres_environment
docker:
- image: *ruby_3_0_image
- image: *postgres_image
- image: *redis_image

tests_ruby_3_2_rails_7_0_postgres:
<<: *run_tests_3_2
environment:
<<: *postgres_environment
<<: *environment
DB: postgres
DB_HOST: localhost
DB_USERNAME: postgres
docker:
- image: *ruby_3_2_image
- image: *postgres_image
- image: *redis_image

tests_ruby_2_7_rails_7_0_mysql:
<<: *run_tests_2_7
tests_ruby_3_2_rails_7_0_mysql:
<<: *run_tests_3_2
environment:
<<: *environment
DB: mysql
Expand All @@ -269,15 +188,14 @@ jobs:
COVERAGE: true
COVERAGE_DIR: /tmp/workspace/simplecov
docker:
- image: *ruby_2_7_image
- image: *ruby_3_2_image
- image: *redis_image
- image: &mysql_image circleci/mysql:8-ram

workflows:
version: 2
main:
jobs:
- bundle_ruby_2_7
- bundle_ruby_3_0
- bundle_ruby_3_2
- tests_ruby_3_2_rails_7_0_postgres:
Expand All @@ -286,6 +204,6 @@ workflows:
- tests_ruby_3_0_rails_7_0_postgres:
requires:
- bundle_ruby_3_0
- tests_ruby_2_7_rails_7_0_mysql:
- tests_ruby_3_2_rails_7_0_mysql:
requires:
- bundle_ruby_2_7
- bundle_ruby_3_2
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins:
enabled: false
config:
file: .rubocop.yml
channel: "rubocop-0-80" # need to keep this value the same as rubocop version
channel: "rubocop-1-50-2" # need to keep this value the same as rubocop version
# https://docs.codeclimate.com/v1.0/docs/rubocop#section-using-rubocop-s-newer-versions
eslint:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require: rubocop-rspec

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 3.0
Exclude:
- '**/sandbox/**/*'
- '**/db/migrate/*'
Expand Down
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ group :test, :development do
gem 'awesome_print'
gem 'gem-release'
gem 'redis'
gem 'rubocop', '~> 1.48.1', require: false # bumped
gem 'rubocop', require: false
gem 'rubocop-rspec', require: false
gem 'pry-byebug'
gem 'webdrivers', '~> 5.3'
gem 'selenium-webdriver'
# Puma 6.0 causes issues in specs due to conflict with capybara version
gem 'puma', '< 6.0'
gem 'ffaker'
Expand All @@ -65,7 +66,4 @@ end
spree_opts = { github: 'spree/spree', branch: 'main' }
gem 'spree_core', spree_opts
gem 'spree_api', spree_opts
# Last version that supports Ruby 2.7
# We should remove this once we drop support for Ruby 2.7
gem 'selenium-webdriver', '~> 4.8.1'
gemspec
2 changes: 1 addition & 1 deletion spree_backend.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
"source_code_uri" => "https://github.com/spree/spree_backend/tree/v#{s.version}",
}

s.required_ruby_version = '>= 2.5'
s.required_ruby_version = '>= 3.0'

s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
s.require_path = 'lib'
Expand Down
Loading