From d11a9f571c00b585d3f2736454c14bfcaf4b975e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janosch=20Mu=CC=88ller?= Date: Fri, 15 Nov 2024 20:09:33 +0100 Subject: [PATCH] Update build, relax AR dependency --- .github/workflows/tests.yml | 29 ++++--------------- .gitignore | 1 + Appraisals | 5 ++-- Gemfile | 3 +- delete_recursively.gemspec | 8 ++--- gemfiles/activerecord_7.0.gemfile | 11 ------- ...d_5.2.gemfile => activerecord_7.2.gemfile} | 4 +-- ...d_6.1.gemfile => activerecord_8.0.gemfile} | 4 +-- spec/dummy_rails_app/config/application.rb | 6 ---- 9 files changed, 18 insertions(+), 53 deletions(-) delete mode 100644 gemfiles/activerecord_7.0.gemfile rename gemfiles/{activerecord_5.2.gemfile => activerecord_7.2.gemfile} (62%) rename gemfiles/{activerecord_6.1.gemfile => activerecord_8.0.gemfile} (62%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbbb2cf..bd3e5b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,29 +8,12 @@ jobs: strategy: matrix: - ruby: [ '3.0', '3.1', '3.2', '3.3', 'ruby-head' ] - activerecord: [ '6.1', '7.0', '7.1' ] # rails < 6 crashes on ruby 3 due to kwargs changes - include: - - ruby: '2.6' - activerecord: '5.2' - - ruby: '2.6' - activerecord: '6.1' - # rails >= 7 requires ruby >= 2.7 - - - ruby: '2.7' - activerecord: '5.2' - - ruby: '2.7' - activerecord: '6.1' - - ruby: '2.7' - activerecord: '7.0' - - ruby: '2.7' - activerecord: '7.1' + ruby: [ '3.1', '3.2', '3.3', 'ruby-head' ] + activerecord: [ '7.1', '7.2', '8.0' ] exclude: - # rails < 7.1 crashes on ruby >= 3.4 due to the removal of mutex_m - - ruby: 'ruby-head' - activerecord: '6.1' - - ruby: 'ruby-head' - activerecord: '7.0' + # rails >= 8 requires ruby >= 3.2 + - ruby: '3.1' + activerecord: '8.0' steps: - uses: actions/checkout@v3 @@ -52,4 +35,4 @@ jobs: - name: Test with activerecord ${{matrix.activerecord}} run: BUNDLE_GEMFILE=./gemfiles/activerecord_${{matrix.activerecord}}.gemfile bundle exec rake - uses: codecov/codecov-action@v3 - if: matrix.ruby >= '3.0' + if: matrix.ruby >= '3.3' diff --git a/.gitignore b/.gitignore index e44f183..a3403ec 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ bin/* binstubs/* bundler_stubs/* Gemfile.lock +local_secret.txt log/ !log/.keep /.bundle/ diff --git a/Appraisals b/Appraisals index c152b77..d68acea 100644 --- a/Appraisals +++ b/Appraisals @@ -1,9 +1,8 @@ # after changes, run `bundle exec appraisal install` %w[ - 5.2 - 6.1 - 7.0 7.1 + 7.2 + 8.0 ].each do |version| constraint = [">= #{version}", "< #{version.sub(/\d+\z/, &:succ)}"] appraise "activerecord-#{version}" do diff --git a/Gemfile b/Gemfile index 5f47492..425d302 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,5 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gemspec group :development, :test do - # until fix for https://github.com/thoughtbot/appraisal/issues/199 is released - gem 'appraisal', github: "thoughtbot/appraisal" + gem 'appraisal', '3.0.0.rc1' end diff --git a/delete_recursively.gemspec b/delete_recursively.gemspec index 4786a09..66f3e58 100644 --- a/delete_recursively.gemspec +++ b/delete_recursively.gemspec @@ -22,13 +22,13 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.1.1' - s.add_dependency 'activerecord', '>= 4.1.14', '< 8.0.0' + s.add_dependency 'activerecord', '>= 4.1.14' s.add_development_dependency 'appraisal', '~> 2.4' - s.add_development_dependency 'rails', '>= 4.1.14', '< 8.0.0' + s.add_development_dependency 'rails', '>= 4.1.14' s.add_development_dependency 'rake', '~> 13.0' s.add_development_dependency 'rspec', '~> 3.10' - s.add_development_dependency 'rspec-rails', '~> 4.0' + s.add_development_dependency 'rspec-rails', '~> 7.1' s.add_development_dependency 'simplecov-cobertura', '~> 2.1' - s.add_development_dependency 'sqlite3', '~> 1.4' + s.add_development_dependency 'sqlite3', '~> 2.1' end diff --git a/gemfiles/activerecord_7.0.gemfile b/gemfiles/activerecord_7.0.gemfile deleted file mode 100644 index 7b2180c..0000000 --- a/gemfiles/activerecord_7.0.gemfile +++ /dev/null @@ -1,11 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", [">= 7.0", "< 7.1"] - -group :development, :test do - gem "rails", [">= 7.0", "< 7.1"] -end - -gemspec path: "../" diff --git a/gemfiles/activerecord_5.2.gemfile b/gemfiles/activerecord_7.2.gemfile similarity index 62% rename from gemfiles/activerecord_5.2.gemfile rename to gemfiles/activerecord_7.2.gemfile index 5ebf9af..6c7aca7 100644 --- a/gemfiles/activerecord_5.2.gemfile +++ b/gemfiles/activerecord_7.2.gemfile @@ -2,10 +2,10 @@ source "https://rubygems.org" -gem "activerecord", [">= 5.2", "< 5.3"] +gem "activerecord", [">= 7.2", "< 7.3"] group :development, :test do - gem "rails", [">= 5.2", "< 5.3"] + gem "rails", [">= 7.2", "< 7.3"] end gemspec path: "../" diff --git a/gemfiles/activerecord_6.1.gemfile b/gemfiles/activerecord_8.0.gemfile similarity index 62% rename from gemfiles/activerecord_6.1.gemfile rename to gemfiles/activerecord_8.0.gemfile index 4147381..a6bd723 100644 --- a/gemfiles/activerecord_6.1.gemfile +++ b/gemfiles/activerecord_8.0.gemfile @@ -2,10 +2,10 @@ source "https://rubygems.org" -gem "activerecord", [">= 6.1", "< 6.2"] +gem "activerecord", [">= 8.0", "< 8.1"] group :development, :test do - gem "rails", [">= 6.1", "< 6.2"] + gem "rails", [">= 8.0", "< 8.1"] end gemspec path: "../" diff --git a/spec/dummy_rails_app/config/application.rb b/spec/dummy_rails_app/config/application.rb index 752ae6a..ee0d3ae 100644 --- a/spec/dummy_rails_app/config/application.rb +++ b/spec/dummy_rails_app/config/application.rb @@ -7,11 +7,5 @@ module DummyRailsApp class Application < Rails::Application - # silence warning on rails 7 - if (Rails::VERSION::MAJOR >= 7 rescue false) - if Rails::VERSION::MINOR == 0 - config.active_record.legacy_connection_handling = false - end - end end end