CI: handle dependencies the same way, add Tilt to the matrix (#1881)

Adds Tilt (https://rubygems.org/gems/tilt) to the CI matrix. It now
resides at https://github.com/jeremyevans/tilt

Changes `latest` to `head` because "latest" sounds a lot like "latest
release" but we mean using the main/master branch of the repo of the
dependency we test with. Matches `ruby-head`.
This commit is contained in:
Patrik Ragnarsson 2023-02-22 08:42:41 +01:00 committed by GitHub
parent e1c903621c
commit 0a424f01ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 21 deletions

View File

@ -11,7 +11,7 @@ permissions:
jobs:
test:
name: ${{ matrix.ruby }} (Rack ${{ matrix.rack }}, Puma ${{ matrix.puma }})
name: ${{ matrix.ruby }} (Rack ${{ matrix.rack }}, Puma ${{ matrix.puma }}, Tilt ${{ matrix.tilt }})
permissions:
contents: read # to fetch code (actions/checkout)
actions: read # to list jobs for workflow run (8398a7/action-slack)
@ -24,23 +24,30 @@ jobs:
- stable
rack:
- '~> 2'
tilt:
- '~> 2.0.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, 3.2, truffleruby]
include:
- { ruby: 2.6, rack: '~> 2', puma: '~> 5' }
- { ruby: 3.2, rack: '~> 2', puma: '~> 5' }
- { ruby: 3.2, rack: '~> 2', puma: latest }
# Puma
- { ruby: 3.1, rack: '~> 2', puma: '~> 5', tilt: '~> 2.0.0' }
- { ruby: 3.2, rack: '~> 2', puma: '~> 6.0', tilt: '~> 2.0.0' }
- { ruby: 3.2, rack: '~> 2', puma: head, tilt: '~> 2.0.0', allow-failure: true }
# Tilt
- { ruby: 3.1, rack: '~> 2', puma: stable, tilt: '~> 2', allow-failure: true }
- { ruby: 3.2, rack: '~> 2', puma: stable, tilt: head, allow-failure: true }
# Due to flaky tests, see https://github.com/sinatra/sinatra/pull/1870
- { ruby: jruby-9.3, rack: '~> 2', puma: stable, allow-failure: true }
- { ruby: jruby-9.3, rack: '~> 2', puma: stable, tilt: '~> 2.0.0', allow-failure: true }
# Due to https://github.com/jruby/jruby/issues/7647
- { ruby: jruby-9.4, rack: '~> 2', puma: stable, allow-failure: true }
- { ruby: jruby-9.4, rack: '~> 2', puma: stable, tilt: '~> 2.0.0', allow-failure: true }
# Never fail our build due to problems with head
- { ruby: ruby-head, rack: '~> 2', puma: stable, allow-failure: true }
- { ruby: jruby-head, rack: '~> 2', puma: stable, allow-failure: true }
- { ruby: truffleruby-head, rack: '~> 2', puma: stable, allow-failure: true }
- { ruby: ruby-head, rack: '~> 2', puma: stable, tilt: '~> 2.0.0', allow-failure: true }
- { ruby: jruby-head, rack: '~> 2', puma: stable, tilt: '~> 2.0.0', allow-failure: true }
- { ruby: truffleruby-head, rack: '~> 2', puma: stable, tilt: '~> 2.0.0', allow-failure: true }
env:
rack: ${{ matrix.rack }}
puma: ${{ matrix.puma }}
tilt: ${{ matrix.tilt }}
steps:
- name: Install dependencies
run: |

View File

@ -15,12 +15,12 @@ gem 'rake'
rack_version = ENV['rack'].to_s
rack_version = nil if rack_version.empty? || (rack_version == 'stable')
rack_version = { github: 'rack/rack' } if rack_version == 'latest'
rack_version = { github: 'rack/rack' } if rack_version == 'head'
gem 'rack', rack_version
puma_version = ENV['puma'].to_s
puma_version = nil if puma_version.empty? || (puma_version == 'stable')
puma_version = { github: 'puma/puma' } if puma_version == 'latest'
puma_version = { github: 'puma/puma' } if puma_version == 'head'
gem 'puma', puma_version
gem 'minitest', '~> 5.0'

View File

@ -7,7 +7,7 @@ gem 'rake'
rack_version = ENV['rack'].to_s
rack_version = nil if rack_version.empty? || (rack_version == 'stable')
rack_version = { github: 'rack/rack' } if rack_version == 'main'
rack_version = { github: 'rack/rack' } if rack_version == 'head'
gem 'rack', rack_version
gem 'sinatra', path: '..'

View File

@ -32,12 +32,12 @@ group :development, :test do
gem 'multi_json'
end
# Allows stuff like `tilt=1.2.2 bundle install` or `tilt=master ...`.
# Used by the CI.
repos = { 'tilt' => 'rtomayko/tilt', 'rack' => 'rack/rack' }
%w[tilt rack].each do |lib|
dep = (ENV[lib] || 'stable').sub "#{lib}-", ''
dep = nil if dep == 'stable'
dep = { github: repos[lib], branch: dep } if dep && dep !~ (/(\d+\.?)+(\d+)?/)
gem lib, dep if dep
end
rack_version = ENV['rack'].to_s
rack_version = nil if rack_version.empty? || (rack_version == 'stable')
rack_version = { github: 'rack/rack' } if rack_version == 'head'
gem 'rack', rack_version
tilt_version = ENV['tilt'].to_s
tilt_version = nil if tilt_version.empty? || (tilt_version == 'stable')
tilt_version = { github: 'jeremyevans/tilt' } if tilt_version == 'head'
gem 'tilt', tilt_version