From 862d2c8953f5c838709dee7bc4fea813e8f2ee8a Mon Sep 17 00:00:00 2001 From: Nony Dutton Date: Mon, 10 Jun 2024 13:07:53 +0200 Subject: [PATCH] Remove upper boundary on ActiveRecord, test main In order to keep this gem up to date with Rails main we'd like to start testing against it on a schedule. Right now this will test against Rails main daily. Once we confirm this gem is compatible with the current Rails main we'll set it up to notify us if the main testing workflow fails 3 days in a row so we can go and fix it. We decided on 3 days in a row and not on _every_ failure just in case it only fails for some flaky reason. I added `/gemfiles/activerecord_main.gemfile.lock` to `.gitignore` because, for obvious reasons, we never want to lock the sha we're using. --- .../workflows/active_record_main_specs.yml | 27 +++++++++++++++++++ .gitignore | 1 + Gemfile.lock | 4 +-- active_record-comments.gemspec | 2 +- gemfiles/activerecord_5.2.gemfile.lock | 4 +-- gemfiles/activerecord_6.0.gemfile.lock | 4 +-- gemfiles/activerecord_6.1.gemfile.lock | 4 +-- gemfiles/activerecord_7.0.gemfile.lock | 4 +-- gemfiles/activerecord_7.1.gemfile.lock | 4 +-- gemfiles/activerecord_main.gemfile | 6 +++++ 10 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/active_record_main_specs.yml create mode 100644 gemfiles/activerecord_main.gemfile diff --git a/.github/workflows/active_record_main_specs.yml b/.github/workflows/active_record_main_specs.yml new file mode 100644 index 0000000..e03594d --- /dev/null +++ b/.github/workflows/active_record_main_specs.yml @@ -0,0 +1,27 @@ +name: CI +on: + schedule: + - cron: "0 0 * * *" # Run every day at 00:00 UTC + workflow_dispatch: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: ['3.1', '3.2', '3.3'] + activerecord: ['main'] + name: ruby${{ matrix.ruby }} activerecord_${{ matrix.activerecord }} + env: + BUNDLE_GEMFILE: gemfiles/activerecord_${{ matrix.activerecord }}.gemfile + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rspec diff --git a/.gitignore b/.gitignore index e512e28..b627935 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ test_db.sqlite .ruby-version +/gemfiles/activerecord_main.gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock index 34c5f64..fa4c055 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: active_record-comments (0.8.0) - activerecord (>= 5, < 7.2) + activerecord (>= 5) GEM remote: https://rubygems.org/ @@ -58,4 +58,4 @@ DEPENDENCIES sqlite3 (~> 1.3, >= 1.3.6) BUNDLED WITH - 2.3.12 + 2.4.22 diff --git a/active_record-comments.gemspec b/active_record-comments.gemspec index cf237a3..58b220f 100644 --- a/active_record-comments.gemspec +++ b/active_record-comments.gemspec @@ -9,6 +9,6 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/grosser/active_record-comments" s.files = `git ls-files lib/ MIT-LICENSE`.split("\n") s.license = "MIT" - s.add_runtime_dependency "activerecord", ">= 5", "< 7.2" + s.add_runtime_dependency "activerecord", ">= 5" s.required_ruby_version = '>= 2.7' end diff --git a/gemfiles/activerecord_5.2.gemfile.lock b/gemfiles/activerecord_5.2.gemfile.lock index 54e0c28..c7638e7 100644 --- a/gemfiles/activerecord_5.2.gemfile.lock +++ b/gemfiles/activerecord_5.2.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: active_record-comments (0.8.0) - activerecord (>= 5, < 7.2) + activerecord (>= 5) GEM remote: https://rubygems.org/ @@ -58,4 +58,4 @@ DEPENDENCIES sqlite3 (~> 1.3, >= 1.3.6) BUNDLED WITH - 2.3.12 + 2.4.22 diff --git a/gemfiles/activerecord_6.0.gemfile.lock b/gemfiles/activerecord_6.0.gemfile.lock index 2cb1a86..9e5d70f 100644 --- a/gemfiles/activerecord_6.0.gemfile.lock +++ b/gemfiles/activerecord_6.0.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: active_record-comments (0.8.0) - activerecord (>= 5, < 7.2) + activerecord (>= 5) GEM remote: https://rubygems.org/ @@ -58,4 +58,4 @@ DEPENDENCIES sqlite3 (~> 1.4) BUNDLED WITH - 2.3.12 + 2.4.22 diff --git a/gemfiles/activerecord_6.1.gemfile.lock b/gemfiles/activerecord_6.1.gemfile.lock index feaa53d..302db9d 100644 --- a/gemfiles/activerecord_6.1.gemfile.lock +++ b/gemfiles/activerecord_6.1.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: active_record-comments (0.8.0) - activerecord (>= 5, < 7.2) + activerecord (>= 5) GEM remote: https://rubygems.org/ @@ -57,4 +57,4 @@ DEPENDENCIES sqlite3 (~> 1.4) BUNDLED WITH - 2.3.12 + 2.4.22 diff --git a/gemfiles/activerecord_7.0.gemfile.lock b/gemfiles/activerecord_7.0.gemfile.lock index 68724fc..5eaeb1f 100644 --- a/gemfiles/activerecord_7.0.gemfile.lock +++ b/gemfiles/activerecord_7.0.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: active_record-comments (0.8.0) - activerecord (>= 5, < 7.2) + activerecord (>= 5) GEM remote: https://rubygems.org/ @@ -55,4 +55,4 @@ DEPENDENCIES sqlite3 (~> 1.4) BUNDLED WITH - 2.3.12 + 2.4.22 diff --git a/gemfiles/activerecord_7.1.gemfile.lock b/gemfiles/activerecord_7.1.gemfile.lock index d8fc6c0..86d2841 100644 --- a/gemfiles/activerecord_7.1.gemfile.lock +++ b/gemfiles/activerecord_7.1.gemfile.lock @@ -2,7 +2,7 @@ PATH remote: .. specs: active_record-comments (0.8.0) - activerecord (>= 5, < 7.2) + activerecord (>= 5) GEM remote: https://rubygems.org/ @@ -79,4 +79,4 @@ DEPENDENCIES sqlite3 (~> 1.4) BUNDLED WITH - 2.4.21 + 2.4.22 diff --git a/gemfiles/activerecord_main.gemfile b/gemfiles/activerecord_main.gemfile new file mode 100644 index 0000000..7490fee --- /dev/null +++ b/gemfiles/activerecord_main.gemfile @@ -0,0 +1,6 @@ +eval_gemfile "common.rb" + +gem "activerecord", github: "rails/rails", branch: "main" +gem "sqlite3", "~> 1.4" + +gem 'pry-byebug'