Skip to content

Commit

Permalink
CI: handle dependencies the same way, add Tilt to the matrix (#1881)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
dentarg committed Feb 22, 2023
1 parent e1c9036 commit 0a424f0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/test.yml
Expand Up @@ -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)
Expand All @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion rack-protection/Gemfile
Expand Up @@ -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: '..'
Expand Down
18 changes: 9 additions & 9 deletions sinatra-contrib/Gemfile
Expand Up @@ -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

0 comments on commit 0a424f0

Please sign in to comment.