From 92c4e6a7baf890c07e5799f7b107b0d594b9eeb8 Mon Sep 17 00:00:00 2001 From: Patrik Ragnarsson Date: Fri, 9 Aug 2024 09:54:15 +0200 Subject: [PATCH] Test against prev, current and next Sinatra release --- .github/workflows/test.yml | 13 ++++++++++--- Gemfile | 5 +++++ support/support.gemspec | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e1c375..1551d75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,16 +10,23 @@ on: jobs: test: - name: Test with Ruby-${{ matrix.ruby }} + name: ${{ matrix.ruby }}, sinatra ${{ matrix.sinatra }}) runs-on: ubuntu-latest timeout-minutes: 15 strategy: fail-fast: false matrix: # 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, 3.2, 3.3, head, truffleruby] + ruby: [2.6, 2.7, '3.0', 3.1, 3.2, 3.3, truffleruby] + sinatra: + - ~> 4.0.0 # current stable include: - - { ruby: jruby, allow-failure: true } + - { ruby: 2.6, sinatra: ~> 3.0.0 } + - { ruby: 3.3, sinatra: head } + - { ruby: head, sinatra: head } + - { ruby: jruby, sinatra: ~> 4.0.0, allow-failure: true } + env: + rack: ${{ matrix.sinatra }} steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 diff --git a/Gemfile b/Gemfile index 0809686..52b3ec1 100644 --- a/Gemfile +++ b/Gemfile @@ -6,3 +6,8 @@ path '.' do Support::Projects.each { |name| gem(name) } gem 'support', group: :development end + +sinatra_version = ENV['sinatra'].to_s +sinatra_version = nil if sinatra_version.empty? || (sinatra_version == 'stable') +sinatra_version = { github: 'sinatra/sinatra' } if sinatra_version == 'head' +gem 'sinatra', sinatra_version diff --git a/support/support.gemspec b/support/support.gemspec index 538894e..edf0e38 100644 --- a/support/support.gemspec +++ b/support/support.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.add_dependency 'rspec' s.add_dependency 'rspec-its' s.add_dependency 'addressable' - s.add_dependency 'sinatra', '~> 1.4' + s.add_dependency 'sinatra' s.add_dependency 'rack-test' s.add_dependency 'rake' s.add_dependency 'yard'