From 0d40ea6538c95fb3c6f70862356d2cb54c02b02e Mon Sep 17 00:00:00 2001 From: Santiago Bartesaghi Date: Tue, 15 Oct 2024 15:00:41 -0300 Subject: [PATCH] Add Rails 7.2 to CI (#671) * Add Rails 7.2 to CI * Fix CI --- .github/workflows/build.yml | 27 +++++++++++++++++++ Appraisals | 15 +++++++++++ ...tive_support_7_2_redis_cache_store.gemfile | 13 +++++++++ ...pport_7_2_redis_cache_store_pooled.gemfile | 14 ++++++++++ gemfiles/rails_7_2.gemfile | 12 +++++++++ ...ive_support_mem_cache_store_pooled_spec.rb | 6 ++++- ...e_support_redis_cache_store_pooled_spec.rb | 6 ++++- 7 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 gemfiles/active_support_7_2_redis_cache_store.gemfile create mode 100644 gemfiles/active_support_7_2_redis_cache_store_pooled.gemfile create mode 100644 gemfiles/rails_7_2.gemfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d7e3b37..64fea25f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,7 @@ jobs: gemfile: - rack_3 - rack_2 + - rails_7_2 - rails_7_1 - rails_7_0 - rails_6_1 @@ -38,6 +39,8 @@ jobs: - redis_5 - redis_4 - connection_pool_dalli + - active_support_7_2_redis_cache_store + - active_support_7_2_redis_cache_store_pooled - active_support_7_1_redis_cache_store - active_support_7_1_redis_cache_store_pooled - active_support_7_0_redis_cache_store @@ -104,6 +107,30 @@ jobs: ruby: '2.6' - gemfile: active_support_7_1_redis_cache_store_pooled ruby: '2.5' + - gemfile: rails_7_2 + ruby: '3.0' + - gemfile: rails_7_2 + ruby: '2.7' + - gemfile: rails_7_2 + ruby: '2.6' + - gemfile: rails_7_2 + ruby: '2.5' + - gemfile: active_support_7_2_redis_cache_store + ruby: '3.0' + - gemfile: active_support_7_2_redis_cache_store + ruby: '2.7' + - gemfile: active_support_7_2_redis_cache_store + ruby: '2.6' + - gemfile: active_support_7_2_redis_cache_store + ruby: '2.5' + - gemfile: active_support_7_2_redis_cache_store_pooled + ruby: '3.0' + - gemfile: active_support_7_2_redis_cache_store_pooled + ruby: '2.7' + - gemfile: active_support_7_2_redis_cache_store_pooled + ruby: '2.6' + - gemfile: active_support_7_2_redis_cache_store_pooled + ruby: '2.5' env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: diff --git a/Appraisals b/Appraisals index 6250f3aa..3d37be3c 100644 --- a/Appraisals +++ b/Appraisals @@ -8,6 +8,10 @@ appraise "rack_2" do gem "rack", "~> 2.0" end +appraise 'rails_7-2' do + gem 'railties', '~> 7.2.0' +end + appraise 'rails_7-1' do gem 'railties', '~> 7.1.0' end @@ -49,6 +53,17 @@ appraise "connection_pool_dalli" do gem "dalli", "~> 3.0" end +appraise "active_support_7-2_redis_cache_store" do + gem "activesupport", "~> 7.2.0" + gem "redis", "~> 5.0" +end + +appraise "active_support_7-2_redis_cache_store_pooled" do + gem "activesupport", "~> 7.2.0" + gem "connection_pool", "~> 2.2" + gem "redis", "~> 5.0" +end + appraise "active_support_7-1_redis_cache_store" do gem "activesupport", "~> 7.1.0" gem "redis", "~> 5.0" diff --git a/gemfiles/active_support_7_2_redis_cache_store.gemfile b/gemfiles/active_support_7_2_redis_cache_store.gemfile new file mode 100644 index 00000000..3c433092 --- /dev/null +++ b/gemfiles/active_support_7_2_redis_cache_store.gemfile @@ -0,0 +1,13 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.2.0" +gem "redis", "~> 5.0" + +group :maintenance, optional: true do + gem "bake" + gem "bake-gem" +end + +gemspec path: "../" diff --git a/gemfiles/active_support_7_2_redis_cache_store_pooled.gemfile b/gemfiles/active_support_7_2_redis_cache_store_pooled.gemfile new file mode 100644 index 00000000..3b441b0b --- /dev/null +++ b/gemfiles/active_support_7_2_redis_cache_store_pooled.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.2.0" +gem "connection_pool", "~> 2.2" +gem "redis", "~> 5.0" + +group :maintenance, optional: true do + gem "bake" + gem "bake-gem" +end + +gemspec path: "../" diff --git a/gemfiles/rails_7_2.gemfile b/gemfiles/rails_7_2.gemfile new file mode 100644 index 00000000..3d3032b4 --- /dev/null +++ b/gemfiles/rails_7_2.gemfile @@ -0,0 +1,12 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "railties", "~> 7.2.0" + +group :maintenance, optional: true do + gem "bake" + gem "bake-gem" +end + +gemspec path: "../" diff --git a/spec/acceptance/stores/active_support_mem_cache_store_pooled_spec.rb b/spec/acceptance/stores/active_support_mem_cache_store_pooled_spec.rb index a04cedab..046919a7 100644 --- a/spec/acceptance/stores/active_support_mem_cache_store_pooled_spec.rb +++ b/spec/acceptance/stores/active_support_mem_cache_store_pooled_spec.rb @@ -7,7 +7,11 @@ describe "ActiveSupport::Cache::MemCacheStore (pooled) as a cache backend" do before do - Rack::Attack.cache.store = ActiveSupport::Cache::MemCacheStore.new(pool_size: 2) + Rack::Attack.cache.store = if ActiveSupport.gem_version >= Gem::Version.new("7.2.0") + ActiveSupport::Cache::MemCacheStore.new(pool: true) + else + ActiveSupport::Cache::MemCacheStore.new(pool_size: 2) + end end after do diff --git a/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb b/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb index 3da658f6..29947381 100644 --- a/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb +++ b/spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb @@ -13,7 +13,11 @@ describe "ActiveSupport::Cache::RedisCacheStore (pooled) as a cache backend" do before do - Rack::Attack.cache.store = ActiveSupport::Cache::RedisCacheStore.new(pool_size: 2) + Rack::Attack.cache.store = if ActiveSupport.gem_version >= Gem::Version.new("7.2.0") + ActiveSupport::Cache::RedisCacheStore.new(pool: true) + else + ActiveSupport::Cache::RedisCacheStore.new(pool_size: 2) + end end after do