Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
inkstak committed Jan 12, 2024
1 parent 0811014 commit dc83a6a
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [ '2.7', '3.0', '3.1', '3.2', head, jruby, jruby-head, truffleruby, truffleruby-head ]
# Test only supported versions: https://endoflife.date/ruby
ruby-version: [ '3.0', '3.1', '3.2', '3.3', head, jruby, jruby-head, truffleruby, truffleruby-head ]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inherit_gem:
- config/ruby-3.0.yml

AllCops:
TargetRubyVersion: 3.2
TargetRubyVersion: 3.3
NewCops: enable
Exclude:
- '**/tmp/**/*'
Expand Down
6 changes: 3 additions & 3 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-12-15 09:01:40 UTC using RuboCop version 1.35.1.
# on 2024-01-12 07:13:01 UTC using RuboCop version 1.59.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 5
# Offense count: 6
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 18
Max: 24
8 changes: 8 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Supported versions of Rails:
# https://endoflife.date/rails
#
appraise "activejob-6.0" do
gem "activejob", "~> 6.0.x"
gem "activesupport", "~> 6.0.x"
Expand All @@ -14,3 +17,8 @@ appraise "activejob-7.0" do
gem "activejob", "~> 7.0.x"
gem "activesupport", "~> 7.0.x"
end

appraise "activejob-7.1" do
gem "activejob", "~> 7.1.x"
gem "activesupport", "~> 7.1.x"
end
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ gemspec

gem "gem-release"
gem "simplecov_json_formatter"

# FIXME: mutex_m must be installed to run CI with ruby head (3.4dev)
gem "mutex_m" # , platforms: :mri_34
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ task :default do
# report offenses from other plugins putted in .rubocop_todo.yml
# https://github.com/testdouble/standard/issues/480

fail unless system "bundle exec appraisal install"
fail unless system "bundle exec appraisal rspec"
fail unless system "bundle exec rubocop"
fail unless system "bundle exec rake standard"
Expand Down
2 changes: 1 addition & 1 deletion lib/activejob-status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def store=(store)
end

def store
@@store ||= (defined?(Rails) && Rails.cache)
@@store ||= (Rails.cache if defined?(Rails))
end

def get(id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative "../spec_helper"
require_relative "../jobs/test_jobs"
require_relative "../../spec_helper"
require_relative "../../jobs/test_jobs"

RSpec.describe ActiveJob::Status do
# FIXME: weird error on JRUBY, happening randomly,
Expand Down Expand Up @@ -202,7 +202,7 @@ def jobs_with(*args, **kwargs)
status: :queued,
serialized_job: {
"arguments" => [],
"enqueued_at" => "2022-10-31T00:00:00Z",
"enqueued_at" => "2022-10-31T00:00:00.000000000Z",
"exception_executions" => {},
"executions" => 0,
"job_class" => "BaseJob",
Expand All @@ -211,7 +211,17 @@ def jobs_with(*args, **kwargs)
"priority" => nil,
"provider_job_id" => nil,
"queue_name" => "default",
"scheduled_at" => nil,
"timezone" => nil
}.tap { |hash|
# FIXME: comparing Gem::Version with String doesn't work in ruby 3.0
# After removing support for 3.0, we could do
# ActiveJob.version < "7.1"
#
if ActiveJob.version < Gem::Version.new("7.1")
hash["enqueued_at"] = "2022-10-31T00:00:00Z"
hash.delete("scheduled_at")
end
}
)
end
Expand All @@ -224,7 +234,7 @@ def jobs_with(*args, **kwargs)
status: :completed,
serialized_job: {
"arguments" => [],
"enqueued_at" => "2022-10-31T00:00:00Z",
"enqueued_at" => "2022-10-31T00:00:00.000000000Z",
"exception_executions" => {},
"executions" => 1,
"job_class" => "BaseJob",
Expand All @@ -233,7 +243,13 @@ def jobs_with(*args, **kwargs)
"priority" => nil,
"provider_job_id" => nil,
"queue_name" => "default",
"scheduled_at" => nil,
"timezone" => nil
}.tap { |hash|
if ActiveJob.version < Gem::Version.new("7.1")
hash["enqueued_at"] = "2022-10-31T00:00:00Z"
hash.delete("scheduled_at")
end
}
)
end
Expand Down

0 comments on commit dc83a6a

Please sign in to comment.