Skip to content

Commit

Permalink
split test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Lachaume committed Dec 31, 2021
1 parent 326cfc7 commit 1de17e0
Show file tree
Hide file tree
Showing 39 changed files with 478 additions and 1,114 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/lint_rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Rubocop

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup System
run: sudo apt-get install libsqlite3-dev
- uses: actions/checkout@v2
- uses: zhulik/[email protected]
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.1'
bundler-cache: true
- name: Lint codebase
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rubocop
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Ruby 2.x
name: Ruby 2.5/2.6

on:
push:
branches: [ master, 0.9-stable ]
pull_request:
branches: [ master, 0.9-stable ]
on: [push, pull_request]

jobs:
build:
Expand All @@ -14,7 +10,6 @@ jobs:
ruby:
- '2.5.9'
- '2.6.7'
- '2.7.3'
appraisal:
- 'google-cloud-tasks-1.0'
- 'google-cloud-tasks-1.1'
Expand Down Expand Up @@ -43,6 +38,5 @@ jobs:
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rubocop
bundle exec appraisal ${APPRAISAL_CONTEXT} bundle
bundle exec appraisal ${APPRAISAL_CONTEXT} rspec
42 changes: 42 additions & 0 deletions .github/workflows/test_ruby_2.7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Ruby 2.7

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- '2.7.5'
appraisal:
- 'google-cloud-tasks-1.0'
- 'google-cloud-tasks-1.1'
- 'google-cloud-tasks-1.2'
- 'google-cloud-tasks-1.3'
- 'rails-5.2'
- 'rails-6.0'
- 'rails-6.1'
- 'rails-7.0'
- 'semantic_logger-3.4'
- 'semantic_logger-4.6'
- 'semantic_logger-4.7.0'
- 'semantic_logger-4.7.2'
steps:
- name: Setup System
run: sudo apt-get install libsqlite3-dev
- uses: actions/checkout@v2
- uses: zhulik/[email protected]
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Build and test with Rake
env:
APPRAISAL_CONTEXT: ${{ matrix.appraisal }}
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec appraisal ${APPRAISAL_CONTEXT} bundle
bundle exec appraisal ${APPRAISAL_CONTEXT} rspec
3 changes: 2 additions & 1 deletion .github/workflows/test_ruby_3.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
matrix:
ruby:
- '3.0.1'
- '3.1.0'
appraisal:
- 'google-cloud-tasks-1.0'
- 'google-cloud-tasks-1.1'
- 'google-cloud-tasks-1.2'
- 'google-cloud-tasks-1.3'
- 'rails-6.1'
- 'rails-7.0'
- 'semantic_logger-3.4'
- 'semantic_logger-4.6'
- 'semantic_logger-4.7.0'
Expand All @@ -35,6 +37,5 @@ jobs:
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rubocop
bundle exec appraisal ${APPRAISAL_CONTEXT} bundle
bundle exec appraisal ${APPRAISAL_CONTEXT} rspec
12 changes: 12 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,49 +1,61 @@
# frozen_string_literal: true

appraise 'google-cloud-tasks-1.0' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'google-cloud-tasks', '1.0'
end

appraise 'google-cloud-tasks-1.1' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'google-cloud-tasks', '1.1'
end

appraise 'google-cloud-tasks-1.2' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'google-cloud-tasks', '1.2'
end

appraise 'google-cloud-tasks-1.3' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'google-cloud-tasks', '1.3'
end

appraise 'rails-5.2' do
gem 'rails', '5.2'
gem 'rspec-rails'
end

appraise 'rails-6.0' do
gem 'rails', '6.0'
gem 'rspec-rails'
end

appraise 'rails-6.1' do
gem 'rails', '6.1'
gem 'rspec-rails'
end

appraise 'rails-7.0' do
gem 'rails', '7.0'
gem 'rspec-rails'
end

appraise 'semantic_logger-3.4' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'semantic_logger', '3.4.1'
end

appraise 'semantic_logger-4.6' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'semantic_logger', '4.6.1'
end

appraise 'semantic_logger-4.7.0' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'semantic_logger', '4.7.0'
end

appraise 'semantic_logger-4.7.2' do
gem 'activesupport', '6.1' # ruby 2.5 / 2.6 compatibility
gem 'semantic_logger', '4.7.2'
end
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,17 @@ To size the concurrency of your queues you should therefore take the most limiti

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
After checking out the repo, run `bin/setup` to install dependencies.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
For tests, run `rake` to run the tests. Note that Rails is not in context by default, which means Rails-specific test will not run.
For tests including Rails-specific tests, run `bundle exec appraisal rails-7.0 rake`
For all context-specific tests (incl. Rails), run the [appraisal tests](Appraisals) using `bundle exec appraisal rake`.

You can 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`.

To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Expand Down
6 changes: 0 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'github_changelog_generator/task'

RSpec::Core::RakeTask.new(:spec)

task default: :spec

GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.user = 'keypup-io'
config.project = 'cloudtasker'
end
6 changes: 1 addition & 5 deletions cloudtasker.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,13 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'github_changelog_generator'
spec.add_development_dependency 'rake', '>= 12.3.3'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-json_expectations', '~> 2.2'
spec.add_development_dependency 'rubocop', '0.76.0'
spec.add_development_dependency 'rubocop-rspec', '1.37.0'
spec.add_development_dependency 'semantic_logger'
spec.add_development_dependency 'sqlite3'
spec.add_development_dependency 'timecop'
spec.add_development_dependency 'webmock'

spec.add_development_dependency 'rails'
spec.add_development_dependency 'rspec-rails'
spec.add_development_dependency 'sqlite3'
end
Loading

0 comments on commit 1de17e0

Please sign in to comment.