Skip to content

armgit / spree

Public Imported from GitHub
0

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.

Test against Ruby 3.0

Damian Legawiec922b8e7ab82d
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 3c3d50e379..cd57aaee34 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,7 +9,12 @@ defaults: &defaults
BUNDLE_PATH: ~/spree/vendor/bundle
working_directory: ~/spree
docker:
- - 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-browsers
run_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 Install
command: |
@@ -38,25 +69,43 @@ run_tests: &run_tests
path: /tmp/test-results
jobs:
- bundle_install:
+ bundle:
<<: *defaults
steps:
- 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 Install
command: |
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_tests
environment: &postgres_environment
<<: *environment
@@ -64,18 +113,26 @@ jobs:
DB_HOST: localhost
DB_USERNAME: postgres
docker:
- - image: *image
- - image: circleci/postgres:12-alpine
+ - image: *ruby_image
+ - image: &postgres_image circleci/postgres:12-alpine
environment:
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_postgres
environment:
<<: *postgres_environment
RAILS_VERSION: '~> 6.0.0'
- run_tests_mysql: &run_tests_mysql
+ tests_mysql: &tests_mysql
<<: *run_tests
environment: &mysql_environment
<<: *environment
@@ -85,12 +142,21 @@ jobs:
COVERAGE: true
COVERAGE_DIR: /tmp/workspace/simplecov
docker:
- - 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_image
command: [--default-authentication-plugin=mysql_native_password]
- run_tests_mysql_60:
- <<: *run_tests_mysql
+ tests_mysql_rails_6_0:
+ <<: *tests_mysql
environment:
<<: *mysql_environment
RAILS_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 Install
command: |
@@ -188,22 +254,29 @@ workflows:
version: 2
main:
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_0
update_staging_repository:
jobs:
- update_staging_repository:
diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rb
index 16b1f52096..177ebe5cc9 100644
--- a/common_spree_dependencies.rb
+++ b/common_spree_dependencies.rb
@@ -35,7 +35,6 @@ group :test do
gem 'webmock', '~> 3.7'
gem 'timecop'
gem 'rails-controller-testing'
- gem 'webrick'
end
group :test, :development do
@@ -43,6 +42,7 @@ group :test, :development do
gem 'rubocop-rspec', require: false
gem 'pry-byebug'
gem 'webdrivers', '~> 4.1'
+ gem 'webrick'
end
gem 'solargraph', group: :development