diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ab754..27d9994 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,15 +18,32 @@ jobs: --health-retries 5 ports: # Maps port 6379 on service container to the host - - '6379:6379' + - "6379:6379" strategy: fail-fast: false matrix: - ruby-version: ['3.0', '3.1', '3.2', '3.3'] - gemfile: ['Gemfile', 'Gemfile.redis3', 'Gemfile.redis4'] + ruby-version: + - "3.0" + - "3.1" + - "3.2" + - "3.3" + resque-version: + - "~> 1.23" + redis-version: + - "~> 3.3" + - "~> 4.8" + resque-scheduler-version: + - "4.3.0" + - "< 4.9.0" + - "~> 4.9" + exclude: + # resque-scheduler (= 4.3.0) depends on redis (~> 3.3) + - redis-version: "~> 4.8" + resque-scheduler-version: "4.3.0" env: - # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps - BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} + REDIS_VERSION: "${{ matrix.redis-version }}" + RESQUE: "${{ matrix.resque-version }}" + RESQUE_SCHEDULER_VERSION: "${{ matrix.resque-scheduler-version }}" steps: - uses: actions/checkout@v4 - name: Set up Ruby ${{ matrix.ruby-version }} diff --git a/Gemfile b/Gemfile index 851fabc..8c785c6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,38 @@ source 'https://rubygems.org' + +case resque_version = ENV.fetch('RESQUE', 'latest') +when 'master' + gem 'resque', git: 'https://github.com/resque/resque' +when /^git:/, /^https:/ + gem 'resque', git: resque_version +when 'latest' + gem 'resque' +else + gem 'resque', resque_version +end + +case redis_version = ENV.fetch('REDIS_VERSION', 'latest') +when 'master' + gem 'redis', git: 'https://github.com/redis/redis-rb' +when /^git:/, /^https:/ + gem 'redis', git: redis_version +when 'latest' + gem 'redis' +else + gem 'redis', redis_version +end + +case resque_scheduler_version = ENV.fetch('RESQUE_SCHEDULER_VERSION', 'none') +when 'master' + gem 'resque-scheduler', git: 'https://github.com/resque/resque-scheduler' +when /^git:/, /^https:/ + gem 'resque-scheduler', git: resque_scheduler_version +when 'latest' + gem 'resque-scheduler' +when 'none' + #noop +else + gem 'resque-scheduler', resque_scheduler_version +end + gemspec diff --git a/Gemfile.redis3 b/Gemfile.redis3 deleted file mode 100644 index 7283c0a..0000000 --- a/Gemfile.redis3 +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' -gemspec - -gem 'redis', '~> 3.3' -gem 'redis-namespace', '~> 1.5.3' diff --git a/Gemfile.redis4 b/Gemfile.redis4 deleted file mode 100644 index b19db31..0000000 --- a/Gemfile.redis4 +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' -gemspec - -gem 'redis', '~> 4.8' -gem 'redis-namespace', '~> 1.9' diff --git a/Rakefile b/Rakefile index 4ae1bf4..ff27e6b 100644 --- a/Rakefile +++ b/Rakefile @@ -10,6 +10,12 @@ Rake::TestTask.new(:test) do |task| task.verbose = true end +desc "Run resque-scheduler integration tests." +Rake::TestTask.new(:test_integration_resque_scheduler) do |task| + task.test_files = FileList["test/integration/resque-scheduler/*_test.rb"] + task.verbose = true +end + desc "Build Yardoc documentation." YARD::Rake::YardocTask.new :yardoc do |t| t.files = ["lib/**/*.rb"] diff --git a/test/lock_test.rb b/test/lock_test.rb index 1550188..a00188d 100644 --- a/test/lock_test.rb +++ b/test/lock_test.rb @@ -13,7 +13,7 @@ def test_resque_plugin_lint end def test_version - major, minor, _patch = Resque::Version.split(".") + major, minor, _patch = Resque::VERSION.split(".") assert_equal 1, major.to_i assert minor.to_i >= 7 end