Skip to content

Commit

Permalink
Don't test Rails 8.0 on Ruby 3.1
Browse files Browse the repository at this point in the history
Also fix a deprecation warning.
  • Loading branch information
janko committed Oct 11, 2024
1 parent 3943f08 commit 87150c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
ruby: ["ruby-2.5", "ruby-2.6", "ruby-2.7", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", "jruby-9.4"]
gemfile: ["rails-5.0", "rails-5.1", "rails-5.2", "rails-6.0", "rails-6.1", "rails-7.0", "rails-7.1", "rails-7.2", "rails-main"]
gemfile: ["rails-5.0", "rails-5.1", "rails-5.2", "rails-6.0", "rails-6.1", "rails-7.0", "rails-7.1", "rails-7.2", "rails-8.0"]
exclude:
- ruby: "ruby-3.3"
gemfile: "rails-5.2"
Expand All @@ -30,14 +30,16 @@ jobs:
gemfile: "rails-5.1"
- ruby: "ruby-3.2"
gemfile: "rails-5.0"
- ruby: "ruby-3.1"
gemfile: "rails-8.0"
- ruby: "ruby-3.1"
gemfile: "rails-5.2"
- ruby: "ruby-3.1"
gemfile: "rails-5.1"
- ruby: "ruby-3.1"
gemfile: "rails-5.0"
- ruby: "ruby-3.0"
gemfile: "rails-main"
gemfile: "rails-8.0"
- ruby: "ruby-3.0"
gemfile: "rails-7.2"
- ruby: "ruby-3.0"
Expand All @@ -47,11 +49,11 @@ jobs:
- ruby: "ruby-3.0"
gemfile: "rails-5.0"
- ruby: "ruby-2.7"
gemfile: "rails-main"
gemfile: "rails-8.0"
- ruby: "ruby-2.7"
gemfile: "rails-7.2"
- ruby: "jruby-9.4"
gemfile: "rails-main"
gemfile: "rails-8.0"
- ruby: "jruby-9.4"
gemfile: "rails-7.2"
- ruby: "jruby-9.4"
Expand All @@ -63,15 +65,15 @@ jobs:
- ruby: "jruby-9.4"
gemfile: "rails-5.0"
- ruby: "ruby-2.6"
gemfile: "rails-main"
gemfile: "rails-8.0"
- ruby: "ruby-2.6"
gemfile: "rails-7.2"
- ruby: "ruby-2.6"
gemfile: "rails-7.1"
- ruby: "ruby-2.6"
gemfile: "rails-7.0"
- ruby: "ruby-2.5"
gemfile: "rails-main"
gemfile: "rails-8.0"
- ruby: "ruby-2.5"
gemfile: "rails-7.2"
- ruby: "ruby-2.5"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.rails-main → gemfiles/Gemfile.rails-8.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gemspec path: ".."
gem "rake", "~> 12.0"
gem "warning"

gem "rails", github: "rails/rails"
gem "rails", "~> 8.0.0.beta1"
gem "sqlite3", "~> 2.0", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby

Expand Down
12 changes: 11 additions & 1 deletion lib/rodauth/rails/feature/instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def return_response(*)
def rails_render(*)
render_output = nil
rails_controller_instance.view_runtime = rails_controller_instance.send(:cleanup_view_runtime) do
Benchmark.ms { render_output = super }
rails_benchmark { render_output = super }
end
render_output
end
Expand Down Expand Up @@ -79,6 +79,16 @@ def build_rails_response(args)
response.request = rails_request
response
end

if ActionPack.version >= Gem::Version.new("8.0.0.beta1")
def rails_benchmark(&block)
ActiveSupport::Benchmark.realtime(:float_millisecond, &block)
end
else
def rails_benchmark(&block)
Benchmark.ms(&block)
end
end
end
end
end
Expand Down

0 comments on commit 87150c8

Please sign in to comment.