From d86f2e730c09a7764800b964d2586c8bccd5726e Mon Sep 17 00:00:00 2001 From: Luke Hill <20105237+luke-hill@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:57:52 +0000 Subject: [PATCH] Refactor/simplify test matrix (#588) * Add ruby 2.6 to include key instead of excluding all bad options * Move ruby 2.7 to include matrix * Unsupported / latest rubies now in include matrix * Final re-ordering of test matrix to get all items working as previously expected (3.0 has an exclusion in owing to capybara) * Remove ruby 2.7 rails 5.2 per the rules Remove duplicate ruby 3.0 testing Update documentation to read better * Remove ruby 3.3 with rails 6.1 from the runtime matrix * Update unsupported rubies with exactly what release of rails is permitted * Update EOL testing notes * Duplicate the notes according to the section they cover so we know why we are excluding combinations in the test matrix * Update apprraisals gemfiles --- .github/workflows/test.yml | 58 ++++++++++++++++++-------------------- Appraisals | 13 +++++---- gemfiles/rails_6_1.gemfile | 2 +- gemfiles/rails_7_0.gemfile | 3 +- gemfiles/rails_7_1.gemfile | 4 +-- gemfiles/rails_7_2.gemfile | 4 +-- 6 files changed, 41 insertions(+), 43 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 71f9d1cb..c0faec9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,45 +16,41 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] + # Latest ruby will only be tested on + # - all rails versions in current major & latest minor rails version of the previous major + # + # Any unsupported ruby will only be tested on + # - rails versions if their patch release is within 6 months of the Ruby EOL date + # - No version of the current rails major + # + # 2.6 -> EOL Mar '22 -> Only test Rails versions initially released before Sep '22 + # 2.7 -> EOL Mar '23 -> Only test Rails versions initially released before Sep '23 + # 3.0 -> EOL Mar '24 -> Only test Rails versions initially released before Sep '24 + include: + - { ruby: '2.6', gemfile: 'rails_5_2' } + - { ruby: '2.7', gemfile: 'rails_6_0' } + - { ruby: '2.7', gemfile: 'rails_6_1' } + # Capybara has an incompatibility here with rails 6. It's easier to just exclude this one run from the matrix until it's out of support + # As such ruby 3.0 is tested on rails 7.0 ONLY as an EXCEPTION to the above rules (Because we need at least one combination of ruby/rails) + # Ruby 3.0+ also won't work with Rails 5.2: https://github.com/rails/rails/issues/40938 + - { ruby: '3.0', gemfile: 'rails_7_0' } + # Ruby 3.1+ has issues with Rails 6.1 https://github.com/rails/rails/issues/46883#issuecomment-1371325906 + # It (Rails 6.1.x), has been marked as a won't fix and as such it's likely this will need to just be excluded until out of support window + - { ruby: '3.3', gemfile: 'rails_7_0' } + - { ruby: '3.3', gemfile: 'rails_7_1' } + - { ruby: '3.3', gemfile: 'rails_7_2' } + # Supported rubies will test all permissible supported rails versions + ruby: ['3.1', '3.2'] gemfile: ['rails_5_2', 'rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2'] exclude: - # Latest ruby will test - # - all rails versions in current major - # - latest rails version in the previous major - # Supported rubies will test - # - all permissible supported rails versions - # Unsupported rubies will test - # - rails versions in each branch if they are released within 6 months of EOL - # - nothing in the current rails major - - # 2.6 -> Unsupported from March '22 -> Only test up to Sep '22 - # 2.7 -> Unsupported from March '23 -> Only test up to Sep '23 - # 3.0/3.1/3.2 -> Supported - - { ruby: '2.6', gemfile: 'rails_6_0' } - - { ruby: '2.6', gemfile: 'rails_6_1' } - - { ruby: '2.6', gemfile: 'rails_7_0' } - - { ruby: '2.6', gemfile: 'rails_7_1' } - - { ruby: '2.6', gemfile: 'rails_7_2' } - - { ruby: '2.7', gemfile: 'rails_7_0' } - - { ruby: '2.7', gemfile: 'rails_7_1' } - - { ruby: '2.7', gemfile: 'rails_7_2' } - - { ruby: '3.0', gemfile: 'rails_7_2' } - # Ruby 3+ won't work with Rails 5.2: https://github.com/rails/rails/issues/40938 - - { ruby: '3.0', gemfile: 'rails_5_2' } - # Capybara has an incompatibility here with rails 6. It's easier to just exclude this one run from the matrix until it's out of support - - { ruby: '3.0', gemfile: 'rails_6_0' } - - { ruby: '3.0', gemfile: 'rails_6_1' } + # Ruby 3.0+ doesn't work with Rails 5.2: https://github.com/rails/rails/issues/40938 + # Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias - { ruby: '3.1', gemfile: 'rails_5_2' } - # Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias - { ruby: '3.1', gemfile: 'rails_6_0' } - { ruby: '3.1', gemfile: 'rails_6_1' } - { ruby: '3.2', gemfile: 'rails_5_2' } - { ruby: '3.2', gemfile: 'rails_6_0' } - { ruby: '3.2', gemfile: 'rails_6_1' } - - { ruby: '3.3', gemfile: 'rails_5_2' } - - { ruby: '3.3', gemfile: 'rails_6_0' } - - { ruby: '3.3', gemfile: 'rails_6_1' } env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: diff --git a/Appraisals b/Appraisals index 1e97ec19..7eb3ee4e 100644 --- a/Appraisals +++ b/Appraisals @@ -29,24 +29,25 @@ appraise 'rails_6_1' do gem 'factory_bot', '< 6.4' gem 'psych', '< 4' gem 'railties', '~> 6.1.7' - gem 'sqlite3', '~> 1.4' + gem 'sqlite3', '< 2' end appraise 'rails_7_0' do gem 'activerecord' gem 'cucumber', '< 10' + gem 'factory_bot', '< 6.6' gem 'railties', '~> 7.0.8' - gem 'sqlite3', '~> 1.7' + gem 'sqlite3', '< 2' end appraise 'rails_7_1' do gem 'activerecord' - gem 'railties', '~> 7.1.3' - gem 'sqlite3', '~> 1.7' + gem 'railties', '~> 7.1.5' + gem 'sqlite3', '~> 2.0' end appraise 'rails_7_2' do gem 'activerecord' - gem 'railties', '~> 7.2.1' - gem 'sqlite3', '~> 1.7' + gem 'railties', '~> 7.2.2' + gem 'sqlite3', '~> 2.2' end diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index a8a89c52..ed7fc2c0 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -7,6 +7,6 @@ gem "capybara", "< 3.38" gem "factory_bot", "< 6.4" gem "psych", "< 4" gem "railties", "~> 6.1.7" -gem "sqlite3", "~> 1.4" +gem "sqlite3", "< 2" gemspec path: "../" diff --git a/gemfiles/rails_7_0.gemfile b/gemfiles/rails_7_0.gemfile index b92b07dc..ddd0b42f 100644 --- a/gemfiles/rails_7_0.gemfile +++ b/gemfiles/rails_7_0.gemfile @@ -4,7 +4,8 @@ source "https://rubygems.org" gem "activerecord" gem "cucumber", "< 10" +gem "factory_bot", "< 6.6" gem "railties", "~> 7.0.8" -gem "sqlite3", "~> 1.7" +gem "sqlite3", "< 2" gemspec path: "../" diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile index f0dd90ce..63ae6858 100644 --- a/gemfiles/rails_7_1.gemfile +++ b/gemfiles/rails_7_1.gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" gem "activerecord" -gem "railties", "~> 7.1.3" -gem "sqlite3", "~> 1.7" +gem "railties", "~> 7.1.5" +gem "sqlite3", "~> 2.0" gemspec path: "../" diff --git a/gemfiles/rails_7_2.gemfile b/gemfiles/rails_7_2.gemfile index d38a60e1..e7a1059d 100644 --- a/gemfiles/rails_7_2.gemfile +++ b/gemfiles/rails_7_2.gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" gem "activerecord" -gem "railties", "~> 7.2.1" -gem "sqlite3", "~> 1.7" +gem "railties", "~> 7.2.2" +gem "sqlite3", "~> 2.2" gemspec path: "../"