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

Refactor/simplify test matrix #588

Merged
merged 10 commits into from
Nov 4, 2024
58 changes: 27 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 7 additions & 6 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: "../"
4 changes: 2 additions & 2 deletions gemfiles/rails_7_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: "../"
4 changes: 2 additions & 2 deletions gemfiles/rails_7_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: "../"