version: 2.1 defaults: &defaults environment: &environment CIRCLE_TEST_REPORTS: /tmp/test-results CIRCLE_ARTIFACTS: /tmp/test-artifacts BUNDLE_JOBS: 4 BUNDLE_RETRY: 3 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 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 parallelism: 8 steps: - checkout - restore_cache: keys: - spree-dashboard-bundle-v10-ruby-3-0-{{ .Branch }} - spree-dashboard-bundle-v10-ruby-3-0 - 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_2: &run_tests_3_2 <<: *defaults_3_2 parallelism: 8 steps: - checkout - restore_cache: keys: - spree-dashboard-bundle-v10-ruby-3-2-{{ .Branch }} - spree-dashboard-bundle-v10-ruby-3-2 - run: name: Install libvips command: sudo apt-get update && sudo apt-get install libvips42 - 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 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 steps: - checkout - restore_cache: keys: - spree-dashboard-bundle-v10-ruby-3-0-{{ .Branch }} - spree-dashboard-bundle-v10-ruby-3-0 - 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-3-0-{{ checksum "Gemfile.lock" }} bundle_ruby_3_2: <<: *defaults_3_2 steps: - checkout - restore_cache: keys: - spree-dashboard-bundle-v10-ruby-3-2-{{ .Branch }} - spree-dashboard-bundle-v10-ruby-3-2 - run: name: Install libvips command: sudo apt-get update && sudo apt-get install libvips42 - 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-3-2-{{ checksum "Gemfile.lock" }} tests_ruby_2_7_rails_7_0_postgres: <<: *run_tests_2_7 environment: &postgres_environment <<: *environment DB: postgres DB_HOST: localhost DB_USERNAME: postgres docker: - image: *ruby_2_7_image - image: *redis_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 docker: - image: *ruby_3_2_image - image: *postgres_image - image: *redis_image tests_ruby_2_7_rails_7_0_mysql: <<: *run_tests_2_7 environment: <<: *environment DB: mysql DB_HOST: 127.0.0.1 DB_USERNAME: root COVERAGE: true COVERAGE_DIR: /tmp/workspace/simplecov docker: - image: *ruby_2_7_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: requires: - bundle_ruby_3_2 - tests_ruby_3_0_rails_7_0_postgres: requires: - bundle_ruby_3_0 - tests_ruby_2_7_rails_7_0_mysql: requires: - bundle_ruby_2_7