Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zzak committed Sep 18, 2024
1 parent 270cd21 commit e2b06c2
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 17 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,64 @@ jobs:
- run: sudo apt-get install redis-server
- run: bundle exec rake

test-activejob:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
redis-version:
- "4.0"
- 4.8
- latest
ruby-version:
- 3.1
- 3.2
- head
rails-version:
- 8.0
- main
env:
REDIS_VERSION: "${{ matrix.redis-version }}"
BUNDLE_GEMFILE: "test/gemfiles/rails-${{ matrix.rails-version }}.gemfile"

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby-version }}"
bundler-cache: true
- run: sudo apt-get install redis-server
- run: bundle exec rake test:activejob

test-activejob-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
redis-version:
- "4.0"
- 4.8
- latest
ruby-version:
- 3.1
- 3.2
- head
rails-version:
- 8.0
- main
env:
REDIS_VERSION: "${{ matrix.redis-version }}"
BUNDLE_GEMFILE: "test/gemfiles/rails-${{ matrix.rails-version }}.gemfile"

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby-version }}"
bundler-cache: true
- run: sudo apt-get install redis-server
- run: bundle exec rake test:activejob:integration

rubocop:
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 0 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@ gem "rack-test", "~> 2.0"
gem "rake"
gem "rubocop", "~> 0.80"
gem "pry"

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.1")
gem "zeitwerk"
gem "resque-scheduler"
# TODO: these are dependencies of loading the dummy app for integration tests
gem "rails", github: "zzak/rails", branch: "aj-extract-adapters"
gem "sqlite3"
end
21 changes: 12 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,28 @@ Rake::TestTask.new do |test|
test.verbose = true
test.libs << "test"
test.libs << "lib"
file_list = FileList['test/*_test.rb']
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.1")
test.libs << "test/active_job"
file_list += FileList['test/active_job/cases/*_test.rb']
end
test.test_files = file_list
test.test_files = FileList['test/*_test.rb']
end

Rake::TestTask.new('test:activejob') do |test|
test.verbose = true
test.libs << "test"
test.libs << "lib"
test.libs << "test/active_job"
test.test_files = FileList['test/active_job/cases/*_test.rb']
end

task "env:integration" do
task "env:aj_integration" do
ENV["AJ_INTEGRATION_TESTS"] = "1"
end

Rake::TestTask.new('test:integration' => 'env:integration') do |t|
Rake::TestTask.new('test:activejob:integration' => 'env:aj_integration') do |t|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.1")
puts "Integration tests require Ruby 3.1 or later"
exit 0
end

t.description = "Run integration tests for ActiveJob::QueueAdapters::ResqueAdapter"
t.description = "Run integration tests for Resque::ActiveJob::Adapter"
t.libs << "test"
t.libs << "test/active_job"
t.test_files = FileList["test/active_job/integration/**/*_test.rb"]
Expand Down
6 changes: 6 additions & 0 deletions test/gemfiles/Gemfile-rails-8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eval_gemfile "../../Gemfile"

gem "rails", github: "zzak/rails", branch: "aj-extract-adapters"
gem "zeitwerk"
gem "resque-scheduler"
gem "sqlite3"
6 changes: 6 additions & 0 deletions test/gemfiles/Gemfile-rails-main
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eval_gemfile "../../Gemfile"

gem "rails", github: "zzak/rails", branch: "aj-extract-adapters"
gem "zeitwerk"
gem "resque-scheduler"
gem "sqlite3"
Loading

0 comments on commit e2b06c2

Please sign in to comment.