Skip to content

Commit 7f5117e

Browse files
committed
Modernize CI matrix and unblock dependency rot
The CI matrix hadn't run since April 2023 and the gem ecosystem has since dropped support for the older Rubies it covered, leaving every job red on PRs: * Ruby 2.3 / 2.4 - bundler resolved loofah 2.21.x against Rails 5.2, which requires Nokogiri::HTML4 (only in nokogiri >= 1.14, itself requiring Ruby 2.6+). * Ruby 2.5 / 2.6 - activesupport 6.1 + concurrent-ruby >= 1.3.5 raises uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger because concurrent-ruby stopped pulling in stdlib Logger. * Ruby 2.7 / 3.0 - all 69 specs pass, but simplecov-cobertura 2.1.0 crashes with REXML::ParseException on rexml >= 3.4.2 at exit and fails the job after the suite is green. * jruby-head / truffleruby-head - both ship bundler 4.x; the \`gem 'bundler', '>= 1.17', '< 3'\` pin in the Gemfile aborts the install before any spec runs. Trim the matrix to Rubies we can actually support today (3.0, 3.1, 3.2, 3.3, 3.4, plus jruby-head and truffleruby-head), bump required_ruby_version to >= 3.0, and update TargetRubyVersion in .rubocop.yml to match. Move the codecov upload to the newest stable Ruby (3.4) and bump the rubocop / yard / check_version jobs along with it. Drop the \`gem 'bundler', '>= 1.17', '< 3'\` line - bundler is environmental, not a runtime dependency, and pinning it broke Rubies that ship with bundler 4. Bump simplecov-cobertura to ~> 3.1 (which fixes the rexml 3.4.2 crash, see jessebs/simplecov-cobertura#44) and pin rexml < 3.4.2 to dodge the still-open regression on 3.4.3+ (jessebs/simplecov-cobertura#48). Replace the deprecated :mingw, :x64_mingw platform tokens with :windows, drop the now-redundant Ruby 2.6 conditional around the rubocop/simplecov gems, and drop the Ruby 2.4 mysql2 guard in spec_helper. Bump actions/checkout to v4 and codecov-action to v4.
1 parent 53f97ea commit 7f5117e

5 files changed

Lines changed: 23 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
ruby: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', jruby-head, truffleruby-head]
17+
ruby: ['3.0', '3.1', '3.2', '3.3', '3.4', jruby-head, truffleruby-head]
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- uses: ruby/setup-ruby@v1
21-
env:
22-
REDIS_VERSION: ${{ matrix.redis }}
2321
with:
2422
ruby-version: ${{ matrix.ruby }}
2523
bundler-cache: true
@@ -29,40 +27,40 @@ jobs:
2927
env:
3028
MYSQL_USER: root
3129
MYSQL_PASSWORD: root
32-
- uses: codecov/codecov-action@v3
33-
if: matrix.ruby == '3.0'
30+
- uses: codecov/codecov-action@v4
31+
if: matrix.ruby == '3.4'
3432
with:
3533
files: coverage/coverage.xml
3634
- run: bin/check-version
3735

3836
rubocop:
3937
runs-on: ubuntu-latest
4038
steps:
41-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
4240
- uses: ruby/setup-ruby@v1
4341
with:
44-
ruby-version: '2.7'
42+
ruby-version: '3.4'
4543
bundler-cache: true
4644
- run: bundle exec rubocop
4745

4846
yard:
4947
runs-on: ubuntu-latest
5048
steps:
51-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
5250
- uses: ruby/setup-ruby@v1
5351
with:
54-
ruby-version: '3.0'
52+
ruby-version: '3.4'
5553
bundler-cache: true
5654
- run: bin/yardoc --fail-on-warning
5755

5856
check_version:
5957
runs-on: ubuntu-latest
6058
if: startsWith(github.ref, 'refs/tags/v')
6159
steps:
62-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6361
- uses: ruby/setup-ruby@v1
6462
with:
65-
ruby-version: '3.0'
63+
ruby-version: '3.4'
6664
bundler-cache: true
6765
- run: bin/check-version
6866

@@ -71,7 +69,7 @@ jobs:
7169
if: startsWith(github.ref, 'refs/tags/v')
7270
runs-on: ubuntu-latest
7371
steps:
74-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
7573
- name: Publish to RubyGems
7674
run: |
7775
mkdir -p $HOME/.gem

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require:
33
- rubocop-rspec
44

55
AllCops:
6-
TargetRubyVersion: 2.3
6+
TargetRubyVersion: 3.0
77

88
Gemspec/DeprecatedAttributeAssignment: { Enabled: true }
99
Gemspec/RequireMFA: { Enabled: true }

Gemfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ gemspec
88
# here. This also allows us to use conditional dependencies that depend on the
99
# platform
1010

11-
not_jruby = %i[ruby mingw x64_mingw].freeze
11+
not_jruby = %i[ruby windows].freeze
1212

1313
gem 'actionpack'
14-
gem 'bundler', '>= 1.17', '< 3'
1514
gem 'byebug', platforms: not_jruby
1615
gem 'irb', '~> 1.0'
1716
# Minimum of 0.5.0 for specific error classes
@@ -25,9 +24,11 @@ gem 'yard', '~> 0.9.25', platforms: not_jruby
2524

2625
gem 'concurrent-ruby'
2726

28-
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
29-
gem 'rubocop', '1.34.1'
30-
gem 'rubocop-rspec', '2.12'
31-
gem 'simplecov', '~> 0.21.0'
32-
gem 'simplecov-cobertura', '~> 2.1'
33-
end
27+
gem 'rubocop', '1.34.1'
28+
gem 'rubocop-rspec', '2.12'
29+
gem 'simplecov', '~> 0.21.0'
30+
gem 'simplecov-cobertura', '~> 3.1'
31+
32+
# simplecov-cobertura crashes with REXML::ParseException: Malformed XML on
33+
# rexml >= 3.4.2. https://github.com/jessebs/simplecov-cobertura/issues/48
34+
gem 'rexml', '< 3.4.2'

cutoff.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
2424
spec.files = Dir['lib/**/*.rb', '*.md', '*.txt', '.yardopts']
2525
spec.require_paths = ['lib']
2626

27-
spec.required_ruby_version = '>= 2.3'
27+
spec.required_ruby_version = '>= 3.0'
2828

2929
spec.add_development_dependency 'rspec', '~> 3.10'
3030
spec.add_development_dependency 'rspec-rails', '~> 5.0'

spec/spec_helper.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@
2727
require 'sidekiq/testing'
2828

2929
begin
30-
# We don't test Mysql2 on Ruby 2.3 since that would require
31-
# installing an old EOL version of OpenSSL
32-
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4')
33-
require 'cutoff/patch/mysql2'
34-
end
30+
require 'cutoff/patch/mysql2'
3531
rescue LoadError
3632
# Ok if mysql2 isn't available
3733
end

0 commit comments

Comments
 (0)