Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Test against Ruby 3.0
Damian Legawiec922b8e7ab82d
diff --git a/.circleci/config.yml b/.circleci/config.ymlindex 3c3d50e379..cd57aaee34 100644--- a/.circleci/config.yml+++ b/.circleci/config.yml@@ -9,7 +9,12 @@ defaults: &defaultsBUNDLE_PATH: ~/spree/vendor/bundleworking_directory: ~/spreedocker:- - image: &image circleci/ruby:2.7-node-browsers+ - image: &ruby_image circleci/ruby:2.7-node-browsers++defaults_3_0: &defaults_3_0+ <<: *defaults+ docker:+ - image: &ruby_3_0_image circleci/ruby:3.0-node-browsersrun_tests: &run_tests<<: *defaults@@ -18,8 +23,34 @@ run_tests: &run_tests- checkout- restore_cache:keys:- - spree-bundle-v6-{{ checksum ".ruby-version" }}-{{ .Branch }}- - spree-bundle-v6-{{ checksum ".ruby-version" }}+ - spree-bundle-v7-{{ checksum ".ruby-version" }}-{{ .Branch }}+ - spree-bundle-v7-{{ checksum ".ruby-version" }}+ - run:+ name: Ensure Bundle Install+ command: |+ bundle install --path=~/spree/vendor/bundle+ ./build-ci.rb install+ - run:+ name: Run rspec in parallel+ command: BUNDLE_GEMFILE=../Gemfile ./build-ci.rb test+ - store_artifacts:+ path: /tmp/test-artifacts+ destination: test-artifacts+ - store_artifacts:+ path: /tmp/test-results+ destination: raw-test-output+ - store_test_results:+ path: /tmp/test-results++run_tests_3_0: &run_tests_3_0+ <<: *defaults_3_0+ parallelism: 4+ steps:+ - checkout+ - restore_cache:+ keys:+ - spree-bundle-v7-ruby-3-0-{{ .Branch }}+ - spree-bundle-v7-ruby-3-0- run:name: Ensure Bundle Installcommand: |@@ -38,25 +69,43 @@ run_tests: &run_testspath: /tmp/test-resultsjobs:- bundle_install:+ bundle:<<: *defaultssteps:- checkout- restore_cache:keys:- - spree-bundle-v6-{{ checksum ".ruby-version" }}-{{ .Branch }}- - spree-bundle-v6-{{ checksum ".ruby-version" }}+ - spree-bundle-v7-{{ checksum ".ruby-version" }}-{{ .Branch }}+ - spree-bundle-v7-{{ checksum ".ruby-version" }}- run:name: Bundle Installcommand: |bundle install --path=~/spree/vendor/bundle./build-ci.rb install- save_cache:- key: spree-bundle-v6-{{ checksum ".ruby-version" }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}+ key: spree-bundle-v7-{{ checksum ".ruby-version" }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}paths:- ~/spree/vendor/bundle- run_tests_postgres: &run_tests_postgres+ bundle_ruby_3_0:+ <<: *defaults_3_0+ steps:+ - checkout+ - restore_cache:+ keys:+ - spree-bundle-v7-ruby-3-0-{{ .Branch }}+ - spree-bundle-v7-ruby-3-0+ - run:+ name: Bundle Install+ command: |+ bundle install --path=~/spree/vendor/bundle+ ./build-ci.rb install+ - save_cache:+ key: spree-bundle-v7-ruby-3-0-{{ .Branch }}-{{ checksum "Gemfile.lock" }}+ paths:+ - ~/spree/vendor/bundle++ tests_postgres: &tests_postgres<<: *run_testsenvironment: &postgres_environment<<: *environment@@ -64,18 +113,26 @@ jobs:DB_HOST: localhostDB_USERNAME: postgresdocker:- - image: *image- - image: circleci/postgres:12-alpine+ - image: *ruby_image+ - image: &postgres_image circleci/postgres:12-alpineenvironment:POSTGRES_USER: postgres- run_tests_postgres_60:- <<: *run_tests_postgres+ tests_postgres_ruby_3_0: &tests_postgres_ruby_3_0+ <<: *run_tests_3_0+ environment:+ <<: *postgres_environment+ docker:+ - image: *ruby_3_0_image+ - image: *postgres_image++ tests_postgres_rails_6_0:+ <<: *tests_postgresenvironment:<<: *postgres_environmentRAILS_VERSION: '~> 6.0.0'- run_tests_mysql: &run_tests_mysql+ tests_mysql: &tests_mysql<<: *run_testsenvironment: &mysql_environment<<: *environment@@ -85,12 +142,21 @@ jobs:COVERAGE: trueCOVERAGE_DIR: /tmp/workspace/simplecovdocker:- - image: *image- - image: circleci/mysql:8-ram+ - image: *ruby_image+ - image: &mysql_image circleci/mysql:8-ram+ command: [--default-authentication-plugin=mysql_native_password]++ tests_mysql_ruby_3_0:+ <<: *run_tests_3_0+ environment:+ <<: *mysql_environment+ docker:+ - image: *ruby_3_0_image+ - image: *mysql_imagecommand: [--default-authentication-plugin=mysql_native_password]- run_tests_mysql_60:- <<: *run_tests_mysql+ tests_mysql_rails_6_0:+ <<: *tests_mysqlenvironment:<<: *mysql_environmentRAILS_VERSION: '~> 6.0.0'@@ -98,8 +164,8 @@ jobs:- checkout- restore_cache:keys:- - spree-bundle-v6-{{ checksum ".ruby-version" }}-{{ .Branch }}- - spree-bundle-v6-{{ checksum ".ruby-version" }}+ - spree-bundle-v7-{{ checksum ".ruby-version" }}-{{ .Branch }}+ - spree-bundle-v7-{{ checksum ".ruby-version" }}- run:name: Ensure Bundle Installcommand: |@@ -188,22 +254,29 @@ workflows:version: 2main:jobs:- - bundle_install- - run_tests_postgres:+ - bundle+ - bundle_ruby_3_0+ - tests_postgres:+ requires:+ - bundle+ - tests_postgres_ruby_3_0:+ requires:+ - bundle_ruby_3_0+ - tests_postgres_rails_6_0:requires:- - bundle_install- - run_tests_postgres_60:+ - bundle+ - tests_mysql:requires:- - bundle_install- - run_tests_mysql:+ - bundle+ - tests_mysql_rails_6_0:requires:- - bundle_install- - run_tests_mysql_60:+ - bundle+ - tests_mysql_ruby_3_0:requires:- - bundle_install+ - bundle_ruby_3_0- send_test_coverage:requires:- - run_tests_mysql_60+ - tests_mysql_rails_6_0update_staging_repository:jobs:- update_staging_repository:diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rbindex 16b1f52096..177ebe5cc9 100644--- a/common_spree_dependencies.rb+++ b/common_spree_dependencies.rb@@ -35,7 +35,6 @@ group :test dogem 'webmock', '~> 3.7'gem 'timecop'gem 'rails-controller-testing'- gem 'webrick'endgroup :test, :development do@@ -43,6 +42,7 @@ group :test, :development dogem 'rubocop-rspec', require: falsegem 'pry-byebug'gem 'webdrivers', '~> 4.1'+ gem 'webrick'endgem 'solargraph', group: :development