From a1c615ef74d2f7e24b34bad9bcbbd2525204cb06 Mon Sep 17 00:00:00 2001 From: Sebastien Savater Date: Wed, 21 Aug 2024 17:29:30 +0200 Subject: [PATCH 1/2] Upgrade CI --- .github/workflows/ci.yml | 2 +- .rubocop.yml | 16 +++++++--------- Appraisals | 23 +++++++++++++++++++++++ Gemfile | 3 ++- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 943a8d4..546b55d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: [ '3.0', '3.1', '3.2', '3.3', 'head' ] + ruby-version: [ '2.7', '3.0', '3.1', '3.2', '3.3', 'head' ] steps: - uses: actions/checkout@v3 diff --git a/.rubocop.yml b/.rubocop.yml index 9f8c0a8..2626d82 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,23 +1,21 @@ inherit_from: .rubocop_todo.yml require: + - standard + - standard-custom + - standard-performance - rubocop-performance - rubocop-rspec - rubocop-rake - - standard inherit_gem: - standard: - - config/base.yml - - config/ruby-2.5.yml - - config/ruby-2.6.yml - - config/ruby-2.7.yml - - config/ruby-3.0.yml + standard: config/ruby-3.0.yml + standard-custom: config/base.yml + standard-performance: config/base.yml AllCops: - # Last supported version before EOL - # See: https://endoflife.date/ruby TargetRubyVersion: 3.0 NewCops: enable Exclude: + - '**/tmp/**/*' - '**/vendor/**/*' diff --git a/Appraisals b/Appraisals index 9cd36d9..fafa614 100644 --- a/Appraisals +++ b/Appraisals @@ -15,3 +15,26 @@ end appraise "elasticsearch-8.9" do gem "elasticsearch", "~> 8.9.0" end + +appraise "elasticsearch-8.15" do + gem "elasticsearch", "~> 8.15.0" +end + +# Supported versions of Rails: +# https://endoflife.date/rails +# +appraise "rails-6.1" do + gem "activesupport", "~> 7.0.x" +end + +appraise "rails-7.0" do + gem "activesupport", "~> 7.0.x" +end + +appraise "rails-7.1" do + gem "activesupport", "~> 7.1.x" +end + +appraise "rails-7.2" do + gem "activesupport", "~> 7.2.x" +end diff --git a/Gemfile b/Gemfile index d9151c2..4bd98d1 100644 --- a/Gemfile +++ b/Gemfile @@ -5,4 +5,5 @@ gemspec gem "gem-release" gem "simplecov_json_formatter" -gem "sqlite3", "~> 1.4.0" +gem "sqlite3" +gem "amazing_print" From 952ddb78d895d961262a95ae934b8a1b6b58b4d7 Mon Sep 17 00:00:00 2001 From: Sebastien Savater Date: Wed, 21 Aug 2024 17:55:50 +0200 Subject: [PATCH 2/2] Add support for unsupported versions --- .github/workflows/ci.yml | 1 + Appraisals | 19 ++++++++++++------- Gemfile | 8 ++++++-- caoutsearch.gemspec | 2 +- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 546b55d..75eadb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + # TODO: we should test only supported versions: https://endoflife.date/ruby ruby-version: [ '2.7', '3.0', '3.1', '3.2', '3.3', 'head' ] steps: diff --git a/Appraisals b/Appraisals index fafa614..4372820 100644 --- a/Appraisals +++ b/Appraisals @@ -23,18 +23,23 @@ end # Supported versions of Rails: # https://endoflife.date/rails # -appraise "rails-6.1" do - gem "activesupport", "~> 7.0.x" +if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new("3.0") + appraise "rails-6.1" do + gem "activesupport", "~> 6.1.x" + gem "sqlite3", "~> 1.4.0" + end end appraise "rails-7.0" do gem "activesupport", "~> 7.0.x" end -appraise "rails-7.1" do - gem "activesupport", "~> 7.1.x" -end +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.1") + appraise "rails-7.1" do + gem "activesupport", "~> 7.1.x" + end -appraise "rails-7.2" do - gem "activesupport", "~> 7.2.x" + appraise "rails-7.2" do + gem "activesupport", "~> 7.2.x" + end end diff --git a/Gemfile b/Gemfile index 4bd98d1..53b0876 100644 --- a/Gemfile +++ b/Gemfile @@ -5,5 +5,9 @@ gemspec gem "gem-release" gem "simplecov_json_formatter" -gem "sqlite3" -gem "amazing_print" + +if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.1") + gem "activesupport", ">= 5.0", "< 7.1" + gem "activerecord", ">= 5.0", "< 7.1" + gem "sqlite3", "~> 1.4.0" +end diff --git a/caoutsearch.gemspec b/caoutsearch.gemspec index a45a541..1e694da 100644 --- a/caoutsearch.gemspec +++ b/caoutsearch.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.files = Dir["lib/**/*"] + %w[LICENSE README.md] s.require_paths = ["lib"] - s.add_dependency "activesupport", ">= 5.0" + s.add_dependency "activesupport", ">= 6.1" s.add_dependency "elasticsearch", "~> 8.x" s.add_dependency "hashie", "~> 5.0" s.add_dependency "multi_json", "~> 1.15"