From d17e838129ec17283b03d77882ac46223340489f Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Tue, 3 Sep 2024 16:37:48 +0200 Subject: [PATCH 1/2] Improve CI - Test against latest stable Ruby versions - Test against AR 7.1 and 7.2 - Sort by AR version descending - Do not test incompatible Ruby / AR versions (ex: Ruby 3.0 / AR 5.x) - Use `include` syntax for legacy AR versions - Mark `edge` tests as `experimental` to allow failures - Update checkout actions - Add explicit permissions for improved security - Fix test warning related to keyword argument in Struct#initialize Ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions --- .github/workflows/test.yml | 67 ++++++++++++++++++++++++++++++++----- Appraisals | 14 ++++++-- gemfiles/ar60.gemfile | 2 +- gemfiles/ar71.gemfile | 7 ++++ gemfiles/ar72.gemfile | 7 ++++ gemfiles/rgeo3.gemfile | 4 +-- test/support/fake_record.rb | 2 +- 7 files changed, 87 insertions(+), 16 deletions(-) create mode 100644 gemfiles/ar71.gemfile create mode 100644 gemfiles/ar72.gemfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 74b824c..afabfd9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,9 @@ name: Tests on: [push, pull_request] +permissions: + contents: read + jobs: test-27-plus: runs-on: ubuntu-latest @@ -9,21 +12,67 @@ jobs: strategy: matrix: ruby: - - head + - "3.3" + - "3.2" + - "3.1" - "3.0" - "2.7" gemfile: - - gemfiles/ar50.gemfile - - gemfiles/ar51.gemfile - - gemfiles/ar52.gemfile - - gemfiles/ar60.gemfile - - gemfiles/ar61.gemfile + - gemfiles/ar72.gemfile + - gemfiles/ar71.gemfile - gemfiles/ar70.gemfile - - gemfiles/rgeo1.gemfile - gemfiles/rgeo3.gemfile + - gemfiles/rgeo1.gemfile + channel: ['stable'] + include: + # Test legacy AR 5.x/6.x series + - ruby: '2.7' + gemfile: gemfiles/ar50.gemfile + channel: 'stable' + - ruby: '2.7' + gemfile: gemfiles/ar51.gemfile + channel: 'stable' + - ruby: '2.7' + gemfile: gemfiles/ar52.gemfile + channel: 'stable' + - ruby: '2.7' + gemfile: gemfiles/ar60.gemfile + channel: 'stable' + - ruby: '2.7' + gemfile: gemfiles/ar61.gemfile + channel: 'stable' + - ruby: '3.0' + gemfile: gemfiles/ar60.gemfile + channel: 'stable' + - ruby: '3.0' + gemfile: gemfiles/ar61.gemfile + channel: 'stable' + - ruby: '3.1' + gemfile: gemfiles/ar61.gemfile + channel: 'stable' + # Test against Ruby head + - ruby: head + gemfile: gemfiles/ar71.gemfile + channel: 'experimental' + - ruby: head + gemfile: gemfiles/ar72.gemfile + channel: 'experimental' + - ruby: head + gemfile: gemfiles/rgeo3.gemfile + channel: 'experimental' + exclude: + - ruby: '2.7' + gemfile: gemfiles/ar72.gemfile + - ruby: '2.7' + gemfile: gemfiles/rgeo3.gemfile + - ruby: '3.0' + gemfile: gemfiles/ar72.gemfile + - ruby: '3.0' + gemfile: gemfiles/rgeo3.gemfile + continue-on-error: ${{ matrix.channel != 'stable' }} steps: - name: Set Up Gems - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set Up Deps run: sudo apt-get install libgeos-dev - name: Set Up Ruby @@ -51,7 +100,7 @@ jobs: - gemfiles/rgeo1.gemfile steps: - name: Set Up Gems - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set Up Deps run: sudo apt-get install libgeos-dev - name: Set Up Ruby diff --git a/Appraisals b/Appraisals index d74e0d3..cf44c0f 100644 --- a/Appraisals +++ b/Appraisals @@ -11,7 +11,7 @@ appraise "ar52" do end appraise "ar60" do - gem "activerecord", "~> 6.0.0.rc1" + gem "activerecord", "~> 6.0.0" end appraise "ar61" do @@ -22,9 +22,17 @@ appraise "ar70" do gem "activerecord", "~> 7.0.0" end +appraise "ar71" do + gem "activerecord", "~> 7.1.0" +end + +appraise "ar72" do + gem "activerecord", "~> 7.2.0" +end + appraise "rgeo3" do - gem "activerecord", "~> 7.0.0" - gem "rgeo", "~> 3.0.0" + gem "activerecord", "~> 7.2.0" + gem "rgeo", "~> 3.0" end appraise "rgeo1" do diff --git a/gemfiles/ar60.gemfile b/gemfiles/ar60.gemfile index b52583e..b07bd13 100644 --- a/gemfiles/ar60.gemfile +++ b/gemfiles/ar60.gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" -gem "activerecord", "~> 6.0.0.rc1" +gem "activerecord", "~> 6.0.0" gemspec path: "../" diff --git a/gemfiles/ar71.gemfile b/gemfiles/ar71.gemfile new file mode 100644 index 0000000..69bc38a --- /dev/null +++ b/gemfiles/ar71.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord", "~> 7.1.0" + +gemspec path: "../" diff --git a/gemfiles/ar72.gemfile b/gemfiles/ar72.gemfile new file mode 100644 index 0000000..9a0f1ea --- /dev/null +++ b/gemfiles/ar72.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord", "~> 7.2.0" + +gemspec path: "../" diff --git a/gemfiles/rgeo3.gemfile b/gemfiles/rgeo3.gemfile index ef31265..cc3713d 100644 --- a/gemfiles/rgeo3.gemfile +++ b/gemfiles/rgeo3.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord", "~> 7.0.0" -gem "rgeo", "~> 3.0.0" +gem "activerecord", "~> 7.2.0" +gem "rgeo", "~> 3.0" gemspec path: "../" diff --git a/test/support/fake_record.rb b/test/support/fake_record.rb index 711b857..2e29671 100644 --- a/test/support/fake_record.rb +++ b/test/support/fake_record.rb @@ -96,7 +96,7 @@ class ConnectionPool attr_reader :spec, :connection def initialize - @spec = Spec.new(adapter: "america") + @spec = Spec.new({ adapter: "america" }) @connection = Connection.new @connection.visitor = Arel::Visitors::ToSql.new(connection) end From fc9fe64848a72f14a6034ff74027a62acf0e5b92 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Thu, 5 Sep 2024 11:53:42 +0200 Subject: [PATCH 2/2] Drop support for legacy Ruby, Rails, and RGeo As per EOL policies, remove support for: - Ruby < 3.1 - Rails < 7.0 Also: - Remove RGeo < 3 support - Test against jruby 9.4.8 and jruby-head --- .github/workflows/test.yml | 75 +++---------------------------- Appraisals | 30 ------------- README.md | 2 + gemfiles/ar50.gemfile | 7 --- gemfiles/ar51.gemfile | 7 --- gemfiles/ar52.gemfile | 7 --- gemfiles/ar60.gemfile | 7 --- gemfiles/ar61.gemfile | 7 --- gemfiles/rgeo1.gemfile | 8 ---- gemfiles/rgeo3.gemfile | 8 ---- lib/rgeo/active_record/version.rb | 2 +- rgeo-activerecord.gemspec | 6 +-- 12 files changed, 12 insertions(+), 154 deletions(-) delete mode 100644 gemfiles/ar50.gemfile delete mode 100644 gemfiles/ar51.gemfile delete mode 100644 gemfiles/ar52.gemfile delete mode 100644 gemfiles/ar60.gemfile delete mode 100644 gemfiles/ar61.gemfile delete mode 100644 gemfiles/rgeo1.gemfile delete mode 100644 gemfiles/rgeo3.gemfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index afabfd9..c60c405 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ permissions: contents: read jobs: - test-27-plus: + tests: runs-on: ubuntu-latest env: BUNDLE_GEMFILE: ${{matrix.gemfile}} @@ -15,60 +15,25 @@ jobs: - "3.3" - "3.2" - "3.1" - - "3.0" - - "2.7" + - "jruby-9.4.8.0" gemfile: - gemfiles/ar72.gemfile - gemfiles/ar71.gemfile - gemfiles/ar70.gemfile - - gemfiles/rgeo3.gemfile - - gemfiles/rgeo1.gemfile channel: ['stable'] include: - # Test legacy AR 5.x/6.x series - - ruby: '2.7' - gemfile: gemfiles/ar50.gemfile - channel: 'stable' - - ruby: '2.7' - gemfile: gemfiles/ar51.gemfile - channel: 'stable' - - ruby: '2.7' - gemfile: gemfiles/ar52.gemfile - channel: 'stable' - - ruby: '2.7' - gemfile: gemfiles/ar60.gemfile - channel: 'stable' - - ruby: '2.7' - gemfile: gemfiles/ar61.gemfile - channel: 'stable' - - ruby: '3.0' - gemfile: gemfiles/ar60.gemfile - channel: 'stable' - - ruby: '3.0' - gemfile: gemfiles/ar61.gemfile - channel: 'stable' - - ruby: '3.1' - gemfile: gemfiles/ar61.gemfile - channel: 'stable' - # Test against Ruby head - ruby: head gemfile: gemfiles/ar71.gemfile channel: 'experimental' - ruby: head gemfile: gemfiles/ar72.gemfile channel: 'experimental' - - ruby: head - gemfile: gemfiles/rgeo3.gemfile + - ruby: jruby-head + gemfile: gemfiles/ar71.gemfile channel: 'experimental' - exclude: - - ruby: '2.7' - gemfile: gemfiles/ar72.gemfile - - ruby: '2.7' - gemfile: gemfiles/rgeo3.gemfile - - ruby: '3.0' + - ruby: jruby-head gemfile: gemfiles/ar72.gemfile - - ruby: '3.0' - gemfile: gemfiles/rgeo3.gemfile + channel: 'experimental' continue-on-error: ${{ matrix.channel != 'stable' }} steps: - name: Set Up Gems @@ -82,31 +47,3 @@ jobs: bundler-cache: true - name: Test run: bundle exec rake - test-26-lower: - runs-on: ubuntu-latest - env: - BUNDLE_GEMFILE: ${{matrix.gemfile}} - strategy: - matrix: - ruby: - - "jruby-9.3.7.0" - - "2.6" - gemfile: - - gemfiles/ar50.gemfile - - gemfiles/ar51.gemfile - - gemfiles/ar52.gemfile - - gemfiles/ar60.gemfile - - gemfiles/ar61.gemfile - - gemfiles/rgeo1.gemfile - steps: - - name: Set Up Gems - uses: actions/checkout@v4 - - name: Set Up Deps - run: sudo apt-get install libgeos-dev - - name: Set Up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Test - run: bundle exec rake diff --git a/Appraisals b/Appraisals index cf44c0f..bf58d9e 100644 --- a/Appraisals +++ b/Appraisals @@ -1,23 +1,3 @@ -appraise "ar50" do - gem "activerecord", "~> 5.0.0" -end - -appraise "ar51" do - gem "activerecord", "~> 5.1.0" -end - -appraise "ar52" do - gem "activerecord", "~> 5.2.0" -end - -appraise "ar60" do - gem "activerecord", "~> 6.0.0" -end - -appraise "ar61" do - gem "activerecord", "~> 6.1.0" -end - appraise "ar70" do gem "activerecord", "~> 7.0.0" end @@ -29,13 +9,3 @@ end appraise "ar72" do gem "activerecord", "~> 7.2.0" end - -appraise "rgeo3" do - gem "activerecord", "~> 7.2.0" - gem "rgeo", "~> 3.0" -end - -appraise "rgeo1" do - gem "activerecord", "~> 5.2.0" - gem "rgeo", "~> 1.0" -end diff --git a/README.md b/README.md index 7c36e65..aa6216d 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ Gemfile: gem 'rgeo-activerecord' ``` +Version `8.0+` supports ActiveRecord 7.x with `rgeo` 3.0+ + Version `7.0+` supports ActiveRecord 5.x, 6.x, and 7.x with `rgeo` 1.0+ Version `6.2+` supports ActiveRecord 5.x and 6.x with `rgeo` 1.0+ diff --git a/gemfiles/ar50.gemfile b/gemfiles/ar50.gemfile deleted file mode 100644 index a7a9bb0..0000000 --- a/gemfiles/ar50.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 5.0.0" - -gemspec path: "../" diff --git a/gemfiles/ar51.gemfile b/gemfiles/ar51.gemfile deleted file mode 100644 index e2f8f85..0000000 --- a/gemfiles/ar51.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 5.1.0" - -gemspec path: "../" diff --git a/gemfiles/ar52.gemfile b/gemfiles/ar52.gemfile deleted file mode 100644 index 027888d..0000000 --- a/gemfiles/ar52.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 5.2.0" - -gemspec path: "../" diff --git a/gemfiles/ar60.gemfile b/gemfiles/ar60.gemfile deleted file mode 100644 index b07bd13..0000000 --- a/gemfiles/ar60.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 6.0.0" - -gemspec path: "../" diff --git a/gemfiles/ar61.gemfile b/gemfiles/ar61.gemfile deleted file mode 100644 index 07548db..0000000 --- a/gemfiles/ar61.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 6.1.0" - -gemspec path: "../" diff --git a/gemfiles/rgeo1.gemfile b/gemfiles/rgeo1.gemfile deleted file mode 100644 index 27b137a..0000000 --- a/gemfiles/rgeo1.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 5.2.0" -gem "rgeo", "~> 1.0" - -gemspec path: "../" diff --git a/gemfiles/rgeo3.gemfile b/gemfiles/rgeo3.gemfile deleted file mode 100644 index cc3713d..0000000 --- a/gemfiles/rgeo3.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 7.2.0" -gem "rgeo", "~> 3.0" - -gemspec path: "../" diff --git a/lib/rgeo/active_record/version.rb b/lib/rgeo/active_record/version.rb index a1bf730..8d5c4ef 100644 --- a/lib/rgeo/active_record/version.rb +++ b/lib/rgeo/active_record/version.rb @@ -2,6 +2,6 @@ module RGeo module ActiveRecord - VERSION = "7.0.1" + VERSION = "8.0.0" end end diff --git a/rgeo-activerecord.gemspec b/rgeo-activerecord.gemspec index e4653da..93444c5 100644 --- a/rgeo-activerecord.gemspec +++ b/rgeo-activerecord.gemspec @@ -12,10 +12,10 @@ Gem::Specification.new do |spec| spec.files = Dir["lib/**/*", "README.md", "History.md", "LICENSE.txt"] - spec.required_ruby_version = ">= 2.5.0" + spec.required_ruby_version = ">= 3.1.0" - spec.add_dependency "activerecord", ">= 5.0" - spec.add_dependency "rgeo", ">= 1.0.0" + spec.add_dependency "activerecord", ">= 7.0" + spec.add_dependency "rgeo", ">= 3.0" spec.add_development_dependency "appraisal", "~> 2.1" spec.add_development_dependency "ffi-geos", "~> 1.2"