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

SP-176 Run specs with ruby 3.3 #60

Merged
merged 1 commit into from
Feb 20, 2024
Merged
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
106 changes: 106 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ defaults: &defaults
- image: &ruby_3_2_image circleci/ruby:3.0-node-browsers
- image: &redis_image circleci/redis:6.2-alpine

defaults_3_3: &defaults_3_3
<<: *defaults
docker:
- image: &ruby_3_3_image cimg/ruby:3.3.0-browsers
- image: *redis_image

run_tests_3_2: &run_tests_3_2
<<: *defaults
parallelism: 8
Expand Down Expand Up @@ -52,6 +58,45 @@ run_tests_3_2: &run_tests_3_2
- store_artifacts:
path: tmp/capybara

run_tests_3_3: &run_tests_3_3
<<: *defaults
parallelism: 8
steps:
- checkout
- restore_cache:
keys:
- spree-storefront-old-bundle-v10-ruby-3-3-{{ .Branch }}
- spree-storefront-old-bundle-v10-ruby-3-3
- 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: 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/capybara

jobs:
bundle_ruby_3_2:
<<: *defaults
Expand Down Expand Up @@ -79,6 +124,32 @@ jobs:
- vendor/bundle
key: spree-storefront-old-bundle-v10-ruby-3-2-{{ checksum "Gemfile.lock" }}

bundle_ruby_3_3:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- spree-storefront-old-bundle-v10-ruby-3-3-{{ .Branch }}
- spree-storefront-old-bundle-v10-ruby-3-3
- 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-storefront-old-bundle-v10-ruby-3-3-{{ checksum "Gemfile.lock" }}

tests_ruby_3_2_rails_7_1_postgres:
<<: *run_tests_3_2
environment: &postgres_environment
Expand Down Expand Up @@ -107,6 +178,34 @@ jobs:
- image: *redis_image
- image: &mysql_image circleci/mysql:8-ram

tests_ruby_3_3_rails_7_1_postgres:
<<: *run_tests_3_3
environment: &postgres_environment
<<: *environment
DB: postgres
DB_HOST: localhost
DB_USERNAME: postgres
docker:
- image: *ruby_3_3_image
- image: &postgres_image circleci/postgres:12-alpine
environment:
POSTGRES_USER: postgres
- image: *redis_image

tests_ruby_3_3_rails_7_1_mysql:
<<: *run_tests_3_3
environment: &mysql_environment
<<: *environment
DB: mysql
DB_HOST: 127.0.0.1
DB_USERNAME: root
COVERAGE: true
COVERAGE_DIR: /tmp/workspace/simplecov
docker:
- image: *ruby_3_3_image
- image: *redis_image
- image: &mysql_image circleci/mysql:8-ram

workflows:
version: 2
main:
Expand All @@ -118,3 +217,10 @@ workflows:
- tests_ruby_3_2_rails_7_1_mysql:
requires:
- bundle_ruby_3_2
- bundle_ruby_3_3
- tests_ruby_3_3_rails_7_1_postgres:
requires:
- bundle_ruby_3_3
- tests_ruby_3_3_rails_7_1_mysql:
requires:
- bundle_ruby_3_3