From 429c663ea6a157371f8cf2f801c93d19a3a25fec Mon Sep 17 00:00:00 2001 From: Shinichi Maeshima Date: Mon, 6 Jul 2026 13:57:31 +0900 Subject: [PATCH 1/2] Test latest Ruby and Active Record in CI Add Ruby4.0, Rails8.0, 8.1 to the CI matrix. Also update actions/checkout to the latest version. Change the Ruby version in the lint workflow to "ruby" so that the latest stable version of Ruby is used automatically. Since the tests currently fail with Minitest 6, I updated the gemspec to restrict Minitest to version 5.x. --- .github/workflows/lint.yml | 4 ++-- .github/workflows/mysql.yml | 21 ++++++++++++++------- .github/workflows/postgresql.yml | 21 ++++++++++++++------- .github/workflows/sqlite.yml | 21 ++++++++++++++------- active_record_doctor.gemspec | 1 + gemfiles/Gemfile.activerecord-8.1.x | 6 ++++++ 6 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 gemfiles/Gemfile.activerecord-8.1.x diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a09b033e..b14197b0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,9 +12,9 @@ jobs: # set LINT to explicitly request rubocop as a dependency. LINT: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.4" + ruby-version: ruby bundler-cache: true - run: bundle exec rake rubocop diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml index a952b7f8..438b1ebd 100644 --- a/.github/workflows/mysql.yml +++ b/.github/workflows/mysql.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: test-latest: - name: "Active Record 8.0 + Ruby 3.4" + name: "Active Record 8.1 + Ruby 4.0" runs-on: ubuntu-latest services: mysql: @@ -21,12 +21,12 @@ jobs: ports: - 3306:3306 env: - BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-8.0.x + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-8.1.x steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.4" + ruby-version: "4.0" bundler-cache: true - name: Prepare the database run: | @@ -63,12 +63,19 @@ jobs: - 3306:3306 strategy: matrix: - ruby: ["3.1", "3.2", "3.3", "3.4"] - active_record: ["7.0", "7.1", "7.2"] + ruby: ["3.1", "3.2", "3.3", "3.4", "4.0"] + active_record: ["7.0", "7.1", "7.2", "8.0", "8.1"] + exclude: + - ruby: "3.1" + active_record: "8.0" + - ruby: "3.1" + active_record: "8.1" + - ruby: "4.0" + active_record: "8.1" env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-${{ matrix.active_record }}.x steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} diff --git a/.github/workflows/postgresql.yml b/.github/workflows/postgresql.yml index b245db19..9d08c9b4 100644 --- a/.github/workflows/postgresql.yml +++ b/.github/workflows/postgresql.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: test-latest: - name: "Active Record 8.0 + Ruby 3.4" + name: "Active Record 8.1 + Ruby 4.0" runs-on: ubuntu-latest services: postgres: @@ -20,12 +20,12 @@ jobs: ports: - 5432:5432 env: - BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-8.0.x + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-8.1.x steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.4" + ruby-version: "4.0" bundler-cache: true - name: Prepare PostgreSQL run: createdb active_record_doctor_secondary @@ -63,12 +63,19 @@ jobs: - 5432:5432 strategy: matrix: - ruby: ["3.1", "3.2", "3.3", "3.4"] - active_record: ["7.0", "7.1", "7.2"] + ruby: ["3.1", "3.2", "3.3", "3.4", "4.0"] + active_record: ["7.0", "7.1", "7.2", "8.0", "8.1"] + exclude: + - ruby: "3.1" + active_record: "8.0" + - ruby: "3.1" + active_record: "8.1" + - ruby: "4.0" + active_record: "8.1" env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-${{ matrix.active_record }}.x steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} diff --git a/.github/workflows/sqlite.yml b/.github/workflows/sqlite.yml index 8bda339a..500c96d0 100644 --- a/.github/workflows/sqlite.yml +++ b/.github/workflows/sqlite.yml @@ -3,15 +3,15 @@ on: [push, pull_request] jobs: test-latest: - name: "Active Record 8.0 + Ruby 3.4" + name: "Active Record 8.1 + Ruby 4.0" runs-on: ubuntu-latest env: - BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-8.0.x + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-8.1.x steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.4" + ruby-version: "4.0" bundler-cache: true - name: Run the test suite against SQLite run: bundle exec rake test:sqlite3 @@ -22,12 +22,19 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ["3.1", "3.2", "3.3", "3.4"] - active_record: ["7.0", "7.1", "7.2"] + ruby: ["3.1", "3.2", "3.3", "3.4", "4.0"] + active_record: ["7.0", "7.1", "7.2", "8.0", "8.1"] + exclude: + - ruby: "3.1" + active_record: "8.0" + - ruby: "3.1" + active_record: "8.1" + - ruby: "4.0" + active_record: "8.1" env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-${{ matrix.active_record }}.x steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} diff --git a/active_record_doctor.gemspec b/active_record_doctor.gemspec index 986f0f50..0421598b 100644 --- a/active_record_doctor.gemspec +++ b/active_record_doctor.gemspec @@ -22,6 +22,7 @@ Gem::Specification.new do |s| s.add_dependency "activerecord", ACTIVE_RECORD_SPEC + s.add_development_dependency "minitest", ">= 5.0", "< 6.0" s.add_development_dependency "minitest-fork_executor", "~> 1.0.2" s.add_development_dependency "mysql2", "~> 0.5.6" s.add_development_dependency "pg", "~> 1.5.9" diff --git a/gemfiles/Gemfile.activerecord-8.1.x b/gemfiles/Gemfile.activerecord-8.1.x new file mode 100644 index 00000000..d4fcd8e9 --- /dev/null +++ b/gemfiles/Gemfile.activerecord-8.1.x @@ -0,0 +1,6 @@ +source "https://rubygems.org" +gemspec path: File.join(File.dirname(__FILE__), "..") + +gem "activerecord", "~> 8.1.0" +gem "pg", "~> 1.5.9" +gem "mysql2", "~> 0.5.6" From 015861e5da646d474b1536d6473de37301178cc8 Mon Sep 17 00:00:00 2001 From: Shinichi Maeshima Date: Mon, 6 Jul 2026 18:28:42 +0900 Subject: [PATCH 2/2] Support Bundler 4 dependency resolution in CI Adding Ruby 4.0 to the CI matrix makes ruby/setup-ruby use Bundler 4, which turns the existing sqlite3 development dependency mismatch into a hard failure before the test suite starts. Previously, Bundler 2 allowed the Active Record 7 Gemfiles to override the gemspec's sqlite3 ~> 2.2.0 development dependency with sqlite3 ~> 1.4, emitting only a warning. Bundler 4 now treats those requirements as conflicting. Relax the gemspec dependency to sqlite3 >= 1.4, < 3.0 so each appraisal Gemfile can select the adapter version required by its Active Record series: sqlite3 1.x for Active Record 7 and sqlite3 2.x for Active Record 8. Also add rdoc as an explicit development dependency because Ruby 4.0 no longer ships rdoc/task as a default gem, and the Rakefile requires it when running the test tasks. --- active_record_doctor.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/active_record_doctor.gemspec b/active_record_doctor.gemspec index 0421598b..78bc108b 100644 --- a/active_record_doctor.gemspec +++ b/active_record_doctor.gemspec @@ -28,7 +28,8 @@ Gem::Specification.new do |s| s.add_development_dependency "pg", "~> 1.5.9" s.add_development_dependency "railties", ACTIVE_RECORD_SPEC s.add_development_dependency "rake", "~> 13.2.1" + s.add_development_dependency "rdoc" s.add_development_dependency "rubocop", "~> 1.68.0" - s.add_development_dependency "sqlite3", "~> 2.2.0" + s.add_development_dependency "sqlite3", ">= 1.4", "< 3.0" s.add_development_dependency "transient_record", "~> 3.0.0" end