Skip to content

Commit

Permalink
Make rails 8 work... maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Nov 11, 2024
1 parent dfd99fc commit 66a78f4
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
- ruby: "3.3"
rails: "6.1.0"
env:
SQLITE3_VERSION: 1.4.1
REDIS_URL: redis://localhost:6379/0
CI: true
RAILS_VERSION: ${{ matrix.rails }}
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,31 @@ jobs:
services:
redis:
image: redis
ports: ['6379:6379']
ports: ["6379:6379"]
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
rails: ['5.2', '6.0.0', '6.1.0', '7.0.0', '7.1.0']
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
rails: ["5.2", "6.0.0", "6.1.0", "7.0.0", "7.1.0", "7.2.0", "8.0.0"]
exclude:
- ruby: "2.6"
rails: "8.0.0"
- ruby: "2.7"
rails: "8.0.0"
- ruby: "3.0"
rails: "8.0.0"
- ruby: "3.1"
rails: "8.0.0"
- ruby: "2.6"
rails: "7.2.0"
- ruby: "2.7"
rails: "7.2.0"
- ruby: "3.0"
rails: "7.2.0"
- ruby: "2.6"
rails: "7.1.0"
- ruby: "2.6"
Expand All @@ -44,7 +58,6 @@ jobs:
- ruby: "3.3"
rails: "6.1.0"
env:
SQLITE3_VERSION: 1.4.1
REDIS_URL: redis://localhost:6379/0
CI: true
RAILS_VERSION: ${{ matrix.rails }}
Expand Down
16 changes: 14 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@ Dir['flipper-*.gemspec'].each do |gemspec|
gemspec(name: "flipper-#{plugin}", development_group: plugin)
end

rails_version = ENV['RAILS_VERSION'] || '8.0'
sqlite3_version = ENV['SQLITE3_VERSION'] || case rails_version
when /8\.\d+/
'2.1.0'
when /7\.\d+/
'1.4.1'
when /6\.\d+/
'1.4.1'
when /5\.\d+/
'1.3.11'
end

gem 'debug'
gem 'rake'
gem 'statsd-ruby', '~> 1.2.1'
gem 'rspec', '~> 3.0'
gem 'rack-test'
gem 'rackup'
gem 'sqlite3', "~> #{ENV['SQLITE3_VERSION'] || '1.4.1'}"
gem 'rails', "~> #{ENV['RAILS_VERSION'] || '7.1'}"
gem 'sqlite3', "~> #{sqlite3_version}"
gem 'rails', "~> #{rails_version}"
gem 'minitest', '~> 5.18'
gem 'minitest-documentation'
gem 'webmock'
Expand Down
2 changes: 1 addition & 1 deletion flipper-active_record.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ Gem::Specification.new do |gem|
gem.metadata = Flipper::METADATA

gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
gem.add_dependency 'activerecord', '>= 4.2', '< 8'
gem.add_dependency 'activerecord', '>= 4.2', '< 9'
end
2 changes: 1 addition & 1 deletion flipper-active_support_cache_store.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ Gem::Specification.new do |gem|
gem.metadata = Flipper::METADATA

gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
gem.add_dependency 'activesupport', '>= 4.2', '< 8'
gem.add_dependency 'activesupport', '>= 4.2', '< 9'
end
24 changes: 20 additions & 4 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,37 @@ cd $(dirname "$0")/..
}

export RAILS_VERSION=5.0.0
export SQLITE3_VERSION=1.3.11
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=5.1.4
export SQLITE3_VERSION=1.3.11
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=5.2.3
export SQLITE3_VERSION=1.3.11
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=6.0.0
export SQLITE3_VERSION=1.4.1
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=6.1.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=7.0.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=7.1.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=7.2.0
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=8.0.0
script/bootstrap || bundle update
bundle exec rake
1 change: 1 addition & 0 deletions test_rails/system/test_help_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require "capybara/cuprite"
require "flipper"
require "flipper/test_help"
require "action_controller/railtie"

require 'action_dispatch/system_testing/server'
ActionDispatch::SystemTesting::Server.silence_puma = true
Expand Down

0 comments on commit 66a78f4

Please sign in to comment.