From 13b160c3e03a87a794754da30caa51ada503ecd1 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 1 Nov 2024 11:06:18 +0100 Subject: [PATCH 1/5] chore: Format circle ci config with prettier --- .circleci/config.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8981dd54..ff993be1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,8 +13,8 @@ orbs: jobs: run-specs: executor: - name: solidusio_extensions/<> - ruby_version: <> + name: solidusio_extensions/<> + ruby_version: <> steps: - checkout - browser-tools/install-chrome @@ -26,7 +26,7 @@ jobs: sudo apt-get install -yq libvips-dev when: always - run: - name: 'Solidus <>: Install gems' + name: "Solidus <>: Install gems" command: | bundle install environment: @@ -34,7 +34,7 @@ jobs: SOLIDUS_BRANCH: <> when: always - run: - name: 'Solidus <>: Install sandbox with generated starter frontend' + name: "Solidus <>: Install sandbox with generated starter frontend" command: | <<#parameters.coverage>>export COVERAGE=true<> bin/sandbox --seed=false --sample=false @@ -44,7 +44,7 @@ jobs: SOLIDUS_BRANCH: <> when: always - run: - name: 'Runs tests on Solidus <>' + name: "Runs tests on Solidus <>" command: | cd sandbox bundle add rspec_junit_formatter --group test @@ -66,17 +66,17 @@ jobs: destination: coverage - run: command: rm -rf sandbox - name: 'Solidus <>: Clean up' + name: "Solidus <>: Clean up" when: always - solidusio_extensions/store-test-results parameters: solidus_branch: type: string - default: 'main' + default: "main" rails_version: type: string - default: '~> 7.1.0' + default: "~> 7.1.0" ruby_version: type: string database: @@ -90,26 +90,26 @@ workflows: jobs: - run-specs: name: run-specs-with-postgres-ruby-3-2 - database: 'postgres' - ruby_version: '3.2' + database: "postgres" + ruby_version: "3.2" - run-specs: name: run-specs-with-postgres-ruby-3-1 - database: 'postgres' - ruby_version: '3.1' + database: "postgres" + ruby_version: "3.1" - run-specs: name: run-specs-with-postgres-ruby-3-0 - database: 'postgres' - ruby_version: '3.0' + database: "postgres" + ruby_version: "3.0" - run-specs: name: run-specs-with-mysql-ruby-3-2 - database: 'mysql' - ruby_version: '3.2' + database: "mysql" + ruby_version: "3.2" - run-specs: name: run-specs-with-sqlite-ruby-3-2 - database: 'sqlite' - ruby_version: '3.2' + database: "sqlite" + ruby_version: "3.2" coverage: true From 9f888f3ddccf27a71be16ce013cae67b88209dc7 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 1 Nov 2024 11:09:42 +0100 Subject: [PATCH 2/5] Add Rails 7.2 support --- .circleci/config.yml | 14 +++++++++++++- Gemfile | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff993be1..107d4da0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,7 @@ jobs: default: "main" rails_version: type: string - default: "~> 7.1.0" + default: "~> 7.2.0" ruby_version: type: string database: @@ -98,11 +98,23 @@ workflows: database: "postgres" ruby_version: "3.1" + - run-specs: + name: run-specs-with-postgres-ruby-3-1-rails-7-1 + database: "postgres" + ruby_version: "3.1" + rails_version: "~> 7.1.0" + - run-specs: name: run-specs-with-postgres-ruby-3-0 database: "postgres" ruby_version: "3.0" + - run-specs: + name: run-specs-with-postgres-ruby-3-0-rails-7-0 + database: "postgres" + ruby_version: "3.0" + rails_version: "~> 7.0.0" + - run-specs: name: run-specs-with-mysql-ruby-3-2 database: "mysql" diff --git a/Gemfile b/Gemfile index 7808dfa3..5aa32cbb 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -gem 'rails', ENV['RAILS_VERSION'] || '~> 7.1.0' +gem 'rails', ENV['RAILS_VERSION'] || '~> 7.2.0' group :development do gem 'guard' From 880acf35a0f17a53adabd3c78295d8145852bf01 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 18 Oct 2024 17:45:11 +0200 Subject: [PATCH 3/5] Remove tests for Ruby 3.0 and test 3.3 instead. Rails 7.2 does not support Ruby 3.0 anymore and it is out of support anyway. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 107d4da0..5594e240 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,14 +105,14 @@ workflows: rails_version: "~> 7.1.0" - run-specs: - name: run-specs-with-postgres-ruby-3-0 + name: run-specs-with-postgres-ruby-3-3 database: "postgres" - ruby_version: "3.0" + ruby_version: "3.3" - run-specs: - name: run-specs-with-postgres-ruby-3-0-rails-7-0 + name: run-specs-with-postgres-ruby-3-1-rails-7-0 database: "postgres" - ruby_version: "3.0" + ruby_version: "3.1" rails_version: "~> 7.0.0" - run-specs: From 386d60731e48e27c29fe135a16faa910b737e128 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Fri, 1 Nov 2024 11:20:28 +0100 Subject: [PATCH 4/5] CI: Fix setting up test database Rails will complain that we have setup the sandbox database in development environment, so we need to reset the db env to test. --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5594e240..d2331b88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,10 +47,12 @@ jobs: name: "Runs tests on Solidus <>" command: | cd sandbox + bin/rails db:environment:set RAILS_ENV=test bundle add rspec_junit_formatter --group test <<#parameters.coverage>>export COVERAGE=true<> bundle exec rspec --format progress --format RspecJunitFormatter --out ../test-results/results.xml environment: + RAILS_ENV: test RAILS_VERSION: <> SOLIDUS_BRANCH: <> when: always From 141173d3d9dfc7809ead3b0fe1855b36ae978a40 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Mon, 4 Nov 2024 15:39:11 +0100 Subject: [PATCH 5/5] CI: Make rails version explicit It is easier to debug which ruby and rails versions we are running with. --- .circleci/config.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d2331b88..e870882f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,6 @@ jobs: default: "main" rails_version: type: string - default: "~> 7.2.0" ruby_version: type: string database: @@ -91,14 +90,22 @@ workflows: "Run specs on development Solidus version": jobs: - run-specs: - name: run-specs-with-postgres-ruby-3-2 + name: run-specs-with-postgres-ruby-3-1-rails-7-2 + database: "postgres" + ruby_version: "3.1" + rails_version: "~> 7.2.0" + + - run-specs: + name: run-specs-with-postgres-ruby-3-2-rails-7-2 database: "postgres" ruby_version: "3.2" + rails_version: "~> 7.2.0" - run-specs: - name: run-specs-with-postgres-ruby-3-1 + name: run-specs-with-postgres-ruby-3-3-rails-7-2 database: "postgres" - ruby_version: "3.1" + ruby_version: "3.3" + rails_version: "~> 7.2.0" - run-specs: name: run-specs-with-postgres-ruby-3-1-rails-7-1 @@ -107,23 +114,20 @@ workflows: rails_version: "~> 7.1.0" - run-specs: - name: run-specs-with-postgres-ruby-3-3 + name: run-specs-with-postgres-ruby-3-2-rails-7-1 database: "postgres" - ruby_version: "3.3" - - - run-specs: - name: run-specs-with-postgres-ruby-3-1-rails-7-0 - database: "postgres" - ruby_version: "3.1" - rails_version: "~> 7.0.0" + ruby_version: "3.2" + rails_version: "~> 7.1.0" - run-specs: - name: run-specs-with-mysql-ruby-3-2 + name: run-specs-with-mysql-ruby-3-2-rails-7-2 database: "mysql" ruby_version: "3.2" + rails_version: "~> 7.2.0" - run-specs: - name: run-specs-with-sqlite-ruby-3-2 + name: run-specs-with-sqlite-ruby-3-2-rails-7-2 database: "sqlite" ruby_version: "3.2" + rails_version: "~> 7.2.0" coverage: true