Allow running with Rack 3. (#1811)
* Allow running with Rack 3. * Pull in `rack-session` gem if needed. * Try again. * Use separate gemfiles for testing. * Better test titles. * Fix dependency on rack-test. * Add rackup gem. * Fix server registration. * Update rack version constraints Co-authored-by: Jordan Owens <jkowens@gmail.com>
This commit is contained in:
parent
a81af47ec1
commit
2ccd0dc29d
|
@ -11,29 +11,30 @@ permissions:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
name: ${{ matrix.ruby }} (Rack ${{ matrix.rack }}, Puma ${{ matrix.puma }})
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
actions: read # to list jobs for workflow run (8398a7/action-slack)
|
actions: read # to list jobs for workflow run (8398a7/action-slack)
|
||||||
|
|
||||||
name: ${{ matrix.ruby }} (Rack ${{ matrix.rack }}, Puma ${{ matrix.puma }})
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
puma:
|
puma:
|
||||||
- '~> 5' # Due to https://github.com/puma/puma/issues/3000
|
|
||||||
rack:
|
|
||||||
- stable
|
- stable
|
||||||
|
rack:
|
||||||
|
- '~> 2'
|
||||||
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
||||||
ruby: [2.6, 2.7, '3.0', 3.1, 'jruby-9.3', truffleruby, truffleruby-head]
|
ruby: [2.6, 2.7, '3.0', 3.1, 'jruby-9.3', truffleruby, truffleruby-head]
|
||||||
include:
|
include:
|
||||||
- { ruby: 3.1, rack: stable, puma: latest, allow-failure: true }
|
- { ruby: 3.1, rack: stable, puma: stable, gemfile: gems/rack-v3.rb, allow-failure: true }
|
||||||
- { ruby: 3.1, rack: latest, allow-failure: true }
|
- { ruby: 3.1, rack: latest, puma: latest, gemfile: gems/rack-v3.rb, allow-failure: true }
|
||||||
- { ruby: jruby-head, rack: stable, allow-failure: true }
|
- { ruby: jruby-head, rack: stable, puma: stable, gemfile: gems/rack-v3.rb, allow-failure: true }
|
||||||
env:
|
env:
|
||||||
rack: ${{ matrix.rack }}
|
rack: ${{ matrix.rack }}
|
||||||
puma: ${{ matrix.puma }}
|
puma: ${{ matrix.puma }}
|
||||||
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -24,7 +24,6 @@ puma_version = { github: 'puma/puma' } if puma_version == 'latest'
|
||||||
gem 'puma', puma_version
|
gem 'puma', puma_version
|
||||||
|
|
||||||
gem 'minitest', '~> 5.0'
|
gem 'minitest', '~> 5.0'
|
||||||
gem 'rack-test', github: 'rack/rack-test'
|
|
||||||
gem 'rubocop', '~> 1.32.0', require: false
|
gem 'rubocop', '~> 1.32.0', require: false
|
||||||
gem 'yard'
|
gem 'yard'
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
eval_gemfile("../Gemfile")
|
||||||
|
|
||||||
|
gem "rackup"
|
||||||
|
gem "rack-session"
|
|
@ -13,5 +13,3 @@ gem 'rack', rack_version
|
||||||
gem 'sinatra', path: '..'
|
gem 'sinatra', path: '..'
|
||||||
|
|
||||||
gemspec
|
gemspec
|
||||||
|
|
||||||
gem 'rack-test', github: 'rack/rack-test'
|
|
||||||
|
|
|
@ -6,8 +6,6 @@ gemspec
|
||||||
gem 'rack-protection', path: '../rack-protection'
|
gem 'rack-protection', path: '../rack-protection'
|
||||||
gem 'sinatra', path: '..'
|
gem 'sinatra', path: '..'
|
||||||
|
|
||||||
gem 'rack-test', github: 'rack/rack-test'
|
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
platform :jruby do
|
platform :jruby do
|
||||||
gem 'json'
|
gem 'json'
|
||||||
|
@ -38,6 +36,6 @@ repos = { 'tilt' => 'rtomayko/tilt', 'rack' => 'rack/rack' }
|
||||||
%w[tilt rack].each do |lib|
|
%w[tilt rack].each do |lib|
|
||||||
dep = (ENV[lib] || 'stable').sub "#{lib}-", ''
|
dep = (ENV[lib] || 'stable').sub "#{lib}-", ''
|
||||||
dep = nil if dep == 'stable'
|
dep = nil if dep == 'stable'
|
||||||
dep = { github: repos[lib], branch: dep } if dep && dep !~ (/(\d+\.)+\d+/)
|
dep = { github: repos[lib], branch: dep } if dep && dep !~ (/(\d+\.?)+(\d+)?/)
|
||||||
gem lib, dep if dep
|
gem lib, dep if dep
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can
|
||||||
s.required_ruby_version = '>= 2.6.0'
|
s.required_ruby_version = '>= 2.6.0'
|
||||||
|
|
||||||
s.add_dependency 'mustermann', '~> 3.0'
|
s.add_dependency 'mustermann', '~> 3.0'
|
||||||
s.add_dependency 'rack', '~> 2.2', '>= 2.2.4'
|
s.add_dependency 'rack', '>= 2.2.4', '< 4'
|
||||||
s.add_dependency 'rack-protection', version
|
s.add_dependency 'rack-protection', version
|
||||||
s.add_dependency 'tilt', '~> 2.0'
|
s.add_dependency 'tilt', '~> 2.0'
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Rack::Handler
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
register 'mock', 'Rack::Handler::Mock'
|
register :mock, Mock
|
||||||
end
|
end
|
||||||
|
|
||||||
class ServerTest < Minitest::Test
|
class ServerTest < Minitest::Test
|
||||||
|
|
Loading…
Reference in New Issue