From 0aa7633f719c43069101072f3ffdbc1e8d651205 Mon Sep 17 00:00:00 2001 From: Masato Ohba Date: Wed, 21 Aug 2024 05:51:53 +0900 Subject: [PATCH] Run CI against rails 7.2 (#138) * Run CI against Rails 7.2 * Reorganize Gemfiles if a specific version of rails require corresponding gem version, it should be in each Gemfile under gemfiles/ * Add exception to test matrix --- .github/workflows/ci.yml | 8 +++++++- Gemfile | 18 ------------------ gemfiles/rails-7.0.gemfile | 7 +++++++ gemfiles/rails-7.1.gemfile | 16 ++++++++++++++++ gemfiles/rails-7.2.gemfile | 21 +++++++++++++++++++++ gemfiles/rails-main.gemfile | 15 +++++++++++++++ 6 files changed, 66 insertions(+), 19 deletions(-) create mode 100644 gemfiles/rails-7.2.gemfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0aeb8327..4591b8e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,21 @@ jobs: fail-fast: false matrix: ruby: [2.7, '3.0', 3.1, 3.2, 3.3, jruby-9.4] - rails: ['7.0', 7.1, main] + rails: ['7.0', 7.1, 7.2, main] exclude: # Rails 7.1 dropped support for older rubygems + - rails: 7.2 + ruby: 2.7 + - rails: 7.2 + ruby: 3.0 - rails: main ruby: 2.7 - rails: main ruby: 3.0 # JDBC adapters don't support the latest Rails + - rails: 7.2 + ruby: jruby-9.4 - rails: main ruby: jruby-9.4 diff --git a/Gemfile b/Gemfile index e690964e..a23d7781 100644 --- a/Gemfile +++ b/Gemfile @@ -13,26 +13,8 @@ group :development do end group :test do - # JDBC versions track Rails versions - if ENV['RAILS_VERSION'] == '7.0' - gem 'activerecord-jdbcsqlite3-adapter', '~> 70.0', platform: :jruby - elsif ENV['RAILS_VERSION'] == '7.1' - gem 'activerecord-jdbc-adapter', '~> 71.0', - platform: :jruby, - # this is not published for some reason - git: 'https://github.com/jruby/activerecord-jdbc-adapter', - glob: 'activerecord-jdbc-adapter.gemspec' - gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0', - platform: :jruby, - # this is not published for some reason - git: 'https://github.com/jruby/activerecord-jdbc-adapter', - glob: 'activerecord-jdbcsqlite3-adapter/activerecord-jdbcsqlite3-adapter.gemspec' - end - gem 'bcrypt' gem 'rspec-rails' - # last supported version of sqlite3 for minimum ruby - gem 'sqlite3', '~> 1.6.0', platform: :ruby gem 'webmock' end diff --git a/gemfiles/rails-7.0.gemfile b/gemfiles/rails-7.0.gemfile index 43db352e..a0f83409 100644 --- a/gemfiles/rails-7.0.gemfile +++ b/gemfiles/rails-7.0.gemfile @@ -3,3 +3,10 @@ eval_gemfile '../Gemfile' gem 'rails', '~> 7.0.0' + +group :test do + # JDBC versions track Rails versions + gem 'activerecord-jdbcsqlite3-adapter', '~> 70.0', platform: :jruby + # last supported version of sqlite3 for minimum ruby + gem 'sqlite3', '~> 1.6.0', platform: :ruby +end diff --git a/gemfiles/rails-7.1.gemfile b/gemfiles/rails-7.1.gemfile index babb65fd..337c3aae 100644 --- a/gemfiles/rails-7.1.gemfile +++ b/gemfiles/rails-7.1.gemfile @@ -3,3 +3,19 @@ eval_gemfile '../Gemfile' gem 'rails', '~> 7.1.0' + +group :test do + # JDBC versions track Rails versions + gem 'activerecord-jdbc-adapter', '~> 71.0', + platform: :jruby, + # this is not published for some reason + git: 'https://github.com/jruby/activerecord-jdbc-adapter', + glob: 'activerecord-jdbc-adapter.gemspec' + gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0', + platform: :jruby, + # this is not published for some reason + git: 'https://github.com/jruby/activerecord-jdbc-adapter', + glob: 'activerecord-jdbcsqlite3-adapter/activerecord-jdbcsqlite3-adapter.gemspec' + # last supported version of sqlite3 for minimum ruby + gem 'sqlite3', '~> 1.6.0', platform: :ruby +end diff --git a/gemfiles/rails-7.2.gemfile b/gemfiles/rails-7.2.gemfile new file mode 100644 index 00000000..fe96d354 --- /dev/null +++ b/gemfiles/rails-7.2.gemfile @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +eval_gemfile '../Gemfile' + +gem 'rails', '~> 7.2.0' + +group :test do + # JDBC versions track Rails versions + gem 'activerecord-jdbc-adapter', '~> 71.0', + platform: :jruby, + # this is not published for some reason + git: 'https://github.com/jruby/activerecord-jdbc-adapter', + glob: 'activerecord-jdbc-adapter.gemspec' + gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0', + platform: :jruby, + # this is not published for some reason + git: 'https://github.com/jruby/activerecord-jdbc-adapter', + glob: 'activerecord-jdbcsqlite3-adapter/activerecord-jdbcsqlite3-adapter.gemspec' + # last supported version of sqlite3 for minimum ruby + gem 'sqlite3', '~> 1.6.0', platform: :ruby +end diff --git a/gemfiles/rails-main.gemfile b/gemfiles/rails-main.gemfile index 80b01d94..7344a203 100644 --- a/gemfiles/rails-main.gemfile +++ b/gemfiles/rails-main.gemfile @@ -3,3 +3,18 @@ eval_gemfile '../Gemfile' gem 'rails', github: 'rails/rails' + +group :test do + # JDBC versions track Rails versions + gem 'activerecord-jdbc-adapter', '~> 71.0', + platform: :jruby, + # this is not published for some reason + git: 'https://github.com/jruby/activerecord-jdbc-adapter', + glob: 'activerecord-jdbc-adapter.gemspec' + gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0', + platform: :jruby, + # this is not published for some reason + git: 'https://github.com/jruby/activerecord-jdbc-adapter', + glob: 'activerecord-jdbcsqlite3-adapter/activerecord-jdbcsqlite3-adapter.gemspec' + gem 'sqlite3', '~> 2.0.0', platform: :ruby +end