Skip to content

Commit

Permalink
Merge pull request #1213 from collectiveidea/update-build-matrix
Browse files Browse the repository at this point in the history
Update build matrix
  • Loading branch information
albus522 authored Aug 13, 2024
2 parents 61cfd03 + 604fb96 commit aea60a4
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 26 deletions.
60 changes: 40 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', jruby-head, ruby-head]
ruby: ['3.1', '3.2', '3.3', jruby-9.4, jruby-head, ruby-head]
rails_version:
- '6.0.0'
- '6.1.0'
- '7.0.0'
- '7.1.0'
- '7.2.0'
- 'edge'
include:
# Rails 5.2
- ruby: 2.6
rails_version: '5.2.0'
- ruby: 2.7
rails_version: '5.2.0'
- ruby: jruby-9.2
rails_version: '5.2.0'

# Ruby 2.6
- ruby: 2.6
rails_version: '6.0.0'
Expand All @@ -39,12 +31,6 @@ jobs:
- ruby: jruby-9.2
rails_version: '6.1.0'

# jruby-9.4
- ruby: jruby-9.4
rails_version: '7.0.0'
- ruby: jruby-9.4
rails_version: 'edge'

#
# The past
#
Expand All @@ -59,11 +45,45 @@ jobs:
rails_version: '5.0.0'
- ruby: 2.5
rails_version: '5.1.0'
- ruby: 2.6
rails_version: '5.2.0'
- ruby: 2.7
rails_version: '5.2.0'
- ruby: jruby-9.2
rails_version: '5.2.0'
- ruby: 2.7
rails_version: '6.0.0'
- ruby: 3.0
rails_version: '6.0.0'
- ruby: 3.2
rails_version: '6.0.0'
- ruby: jruby-9.4
rails_version: '6.0.0'
- ruby: 2.7
rails_version: '6.1.0'
- ruby: 3.0
rails_version: '6.1.0'
- ruby: 3.2
rails_version: '6.1.0'
- ruby: jruby-9.4
rails_version: '6.0.0'
- ruby: 2.7
rails_version: '7.0.0'
- ruby: 3.0
rails_version: '7.0.0'
- ruby: jruby-9.4
rails_version: '6.0.0'

# EOL Ruby
- ruby: 2.7
rails_version: '7.1.0'
- ruby: 3.0
rails_version: '7.1.0'

continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
env:
RAILS_VERSION: ${{ matrix.rails_version }}
Expand All @@ -75,7 +95,7 @@ jobs:
RAILS_VERSION: ${{ matrix.rails_version }}
run: bundle exec rspec
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.ruby }}-${{ matrix.rails_version }}
Expand All @@ -86,7 +106,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
4 changes: 2 additions & 2 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Generate lockfile for cache key
run: bundle lock
- name: Cache gems
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
Expand Down
14 changes: 14 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ platforms :ruby do
# Rails 6 now requires sqlite 1.4
if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1'
gem 'sqlite3', '< 1.4'
elsif ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '7.2'
gem 'sqlite3', '~> 1.4'
else
gem 'sqlite3'
end
Expand Down Expand Up @@ -51,6 +53,11 @@ group :test do
elsif ENV['RAILS_VERSION']
gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}"
gem 'activerecord', "~> #{ENV['RAILS_VERSION']}"
if ENV['RAILS_VERSION'] < '5.1'
gem 'loofah', '2.3.1'
gem 'nokogiri', '< 1.11.0'
gem 'rails-html-sanitizer', '< 1.4.0'
end
else
gem 'actionmailer', ['>= 3.0', '< 8.0']
gem 'activerecord', ['>= 3.0', '< 8.0']
Expand All @@ -64,6 +71,13 @@ group :test do
else
gem 'simplecov-lcov', :require => false
end
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0')
# New dependencies with a deprecation notice in Ruby 3.3 and required in Ruby 3.4
# Probably won't get released in rails 7.0
gem 'base64'
gem 'bigdecimal'
gem 'mutex_m'
end
if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] >= '6.0.0'
gem 'zeitwerk', :require => false
end
Expand Down
7 changes: 6 additions & 1 deletion lib/delayed/backend/shared_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,12 @@ def create_job(opts = {})
worker.work_off
@job.reload
expect(@job.last_error).to match(/did not work/)
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/)
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
# Ruby 3.4 produces a more verbose message
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in 'ErrorJob#perform'/)
else
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/)
end
expect(@job.attempts).to eq(1)
expect(@job.run_at).to be > Delayed::Job.db_time_now - 10.minutes
expect(@job.run_at).to be < Delayed::Job.db_time_now + 10.minutes
Expand Down
10 changes: 7 additions & 3 deletions lib/delayed/message_sending.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module Delayed
class DelayProxy < BasicObject
undef_method :==
undef_method :equal?
# What additional methods exist on BasicObject has changed over time
(::BasicObject.instance_methods - [:__id__, :__send__, :instance_eval, :instance_exec]).each do |method|
undef_method method
end

# Let DelayProxy raise exceptions.
define_method(:raise, ::Object.instance_method(:raise))
def raise(*args)
::Object.send(:raise, *args)
end

def initialize(payload_class, target, options)
@payload_class = payload_class
Expand Down

0 comments on commit aea60a4

Please sign in to comment.