diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8bcbd1c..ba68552 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,17 +25,19 @@ jobs: ports: # Maps port 6379 on service container to the host - 6379:6379 + strategy: + matrix: + sidekiq-version: ["7", "8"] env: - BUNDLE_VERSION: "~> 2.1.4" + BUNDLE_VERSION: "~> 2.7.2" BUNDLE_GEMS__CONTRIBSYS__COM: ${{ secrets.BUNDLE_GEMS__CONTRIBSYS__COM }} steps: - name: Checkout code - uses: actions/checkout@v4 - - name: Install Ruby and gems + uses: actions/checkout@v5 + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.2.5' + ruby-version: "3.3.7" bundler-cache: true - - name: Run tests - run: | - bundle exec rake ci:specs + - name: Install dependencies and Run tests + run: bundle exec rake test:sidekiq${{ matrix.sidekiq-version }} diff --git a/Gemfile b/Gemfile index 06e22e6..c1b27ba 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,10 @@ source "https://rubygems.org" source "https://gems.contribsys.com/" do - gem "sidekiq-pro", "7.3.0" + gem "sidekiq-pro", ">= 7.3.0", "< 9" end -gem "sidekiq", "7.3.0" +gem "sidekiq", ">= 7.3.0", "< 9" # Specify your gem's dependencies in simplekiq.gemspec gemspec diff --git a/Gemfile.sidekiq7 b/Gemfile.sidekiq7 new file mode 100644 index 0000000..06e22e6 --- /dev/null +++ b/Gemfile.sidekiq7 @@ -0,0 +1,10 @@ +source "https://rubygems.org" + +source "https://gems.contribsys.com/" do + gem "sidekiq-pro", "7.3.0" +end + +gem "sidekiq", "7.3.0" + +# Specify your gem's dependencies in simplekiq.gemspec +gemspec diff --git a/README.md b/README.md index ae1032d..1b47c1c 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,12 @@ This project follows semantic versioning. See https://semver.org/ for details. After checking out the repo, run `bin/setup` to install dependencies. Note that this depends on `sidekiq-pro` which requires a [commercial license](https://sidekiq.org/products/pro.html) to install and use. -Then, run `rake ci:specs` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +Then, run `rake ci:specs` to run the tests. You can also run: +- `rake test:sidekiq8` to test against Sidekiq 8.0 (default) +- `rake test:sidekiq7` to test against Sidekiq 7.3 +- `rake test:all` to test against all supported Sidekiq versions + +You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. diff --git a/Rakefile b/Rakefile index 2b18c34..8017089 100644 --- a/Rakefile +++ b/Rakefile @@ -7,3 +7,20 @@ FileList["tasks/*.rake"].each { |task| load task } RSpec::Core::RakeTask.new(:spec) task default: :spec + +namespace :test do + desc "Test against Sidekiq 8.0 (default)" + task :sidekiq8 do + sh "bundle install" + sh "bundle exec rspec" + end + + desc "Test against Sidekiq 7.3" + task :sidekiq7 do + sh "bundle install --gemfile=Gemfile.sidekiq7" + sh "bundle exec rspec" + end + + desc "Test against all Sidekiq versions" + task :all => [:sidekiq8, :sidekiq7] +end diff --git a/simplekiq.gemspec b/simplekiq.gemspec index e94d17b..51b3fef 100644 --- a/simplekiq.gemspec +++ b/simplekiq.gemspec @@ -29,6 +29,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "pry" spec.add_development_dependency "standard" - spec.add_dependency "sidekiq", ">= 7.3.0" - spec.add_dependency "sidekiq-pro", "~> 7.3.0" + spec.add_dependency "sidekiq", ">= 7.3.0", "< 9.0" + spec.add_dependency "sidekiq-pro", ">= 7.3.0", "< 9.0" end