From ff5983cf8c50b743b78c87fa9d805103fc9a0db8 Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Tue, 17 Jan 2023 17:48:33 -0300 Subject: [PATCH 1/5] Don't allow redis 5.x yet We're not compatible. --- Gemfile.lock | 2 +- modis.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6c28cee..d9d9cea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,7 @@ PATH activesupport (>= 5.2) connection_pool (>= 2) msgpack (>= 0.5) - redis (>= 3.0) + redis (>= 3.0, < 5.0) GEM remote: https://rubygems.org/ diff --git a/modis.gemspec b/modis.gemspec index d9f87b6..4aef97b 100644 --- a/modis.gemspec +++ b/modis.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'activemodel', '>= 5.2' gem.add_runtime_dependency 'activesupport', '>= 5.2' - gem.add_runtime_dependency 'redis', '>= 3.0' + gem.add_runtime_dependency 'redis', '>= 3.0', '< 5.0' gem.add_runtime_dependency 'connection_pool', '>= 2' if defined? JRUBY_VERSION From 5448c9f1ad78d4a0a2c0e3ffb44c573a746b8a8d Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Tue, 17 Jan 2023 19:25:40 -0300 Subject: [PATCH 2/5] More modern ruby for local dev --- .ruby-version | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index 57cf282..ff365e0 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +3.1.3 diff --git a/Gemfile.lock b/Gemfile.lock index 6c28cee..fc8c5dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,7 +36,7 @@ GEM i18n (1.8.5) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) - minitest (5.14.2) + minitest (5.17.0) msgpack (1.3.3) parallel (1.20.1) parser (3.0.1.0) @@ -70,7 +70,7 @@ GEM simplecov (0.18.5) docile (~> 1.1) simplecov-html (~> 0.11) - simplecov-html (0.12.2) + simplecov-html (0.12.3) thor (1.0.1) thread_safe (0.3.6) tzinfo (1.2.7) From 7446d5803382f0b195f53f78319ac7ab618a9729 Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Tue, 17 Jan 2023 19:48:52 -0300 Subject: [PATCH 3/5] We're actually not compatible with redis 4.7 --- Gemfile.lock | 2 +- modis.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d9d9cea..71873b3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,7 @@ PATH activesupport (>= 5.2) connection_pool (>= 2) msgpack (>= 0.5) - redis (>= 3.0, < 5.0) + redis (>= 3.0, < 4.7) GEM remote: https://rubygems.org/ diff --git a/modis.gemspec b/modis.gemspec index 4aef97b..cb0a66a 100644 --- a/modis.gemspec +++ b/modis.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'activemodel', '>= 5.2' gem.add_runtime_dependency 'activesupport', '>= 5.2' - gem.add_runtime_dependency 'redis', '>= 3.0', '< 5.0' + gem.add_runtime_dependency 'redis', '>= 3.0', '< 4.7' gem.add_runtime_dependency 'connection_pool', '>= 2' if defined? JRUBY_VERSION From 2cda0c4b3140ed40afccdfdccebde1e8adc57afb Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Tue, 17 Jan 2023 17:06:05 -0300 Subject: [PATCH 4/5] Switch from Travis CI to GH actions Closes #33 --- .github/workflows/test.yml | 67 ++++++++++++++++++++++++++++++++ .travis.yml | 42 -------------------- README.md | 1 - Rakefile | 4 +- gemfiles/rails_7.0.gemfile | 8 ++++ lib/tasks/quality.rake | 2 +- spec/spec_helper.rb | 2 +- spec/support/simplecov_helper.rb | 2 +- 8 files changed, 80 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml create mode 100644 gemfiles/rails_7.0.gemfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bf1fbc4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,67 @@ +name: Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CI: "true" + +jobs: + test: + runs-on: ubuntu-22.04 + + services: + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps port 6379 on service container to the host + - 6379:6379 + + strategy: + matrix: + gemfile: ['rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0'] + + ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1'] + + exclude: + # Rails 5.2 requires Ruby < 3.0 + # https://github.com/rails/rails/issues/40938 + - ruby: '3.0' + gemfile: 'rails_5.2' + - ruby: '3.1' + gemfile: 'rails_5.2' + # Rails >= 6 requires Ruby >= 2.5 + - ruby: '2.4' + gemfile: 'rails_6.0' + - ruby: '2.4' + gemfile: 'rails_6.1' + # Rails >= 7 requires Ruby >= 2.7 + - ruby: '2.4' + gemfile: 'rails_7.0' + - ruby: '2.5' + gemfile: 'rails_7.0' + - ruby: '2.6' + gemfile: 'rails_7.0' + + env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile + + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run tests + run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 14e8ed0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: ruby - -dist: bionic - -cache: bundler - -services: - - redis-server - -rvm: - - 2.3 - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - 3.0 - - jruby-9.2.17.0 - -gemfile: - - gemfiles/rails_5.2.gemfile - - gemfiles/rails_6.0.gemfile - - gemfiles/rails_6.1.gemfile - -matrix: - fast_finish: true - exclude: - # Rails 6 requires Ruby 2.5 or higher - - gemfile: gemfiles/rails_6.0.gemfile - rvm: 2.3 - - gemfile: gemfiles/rails_6.1.gemfile - rvm: 2.3 - - gemfile: gemfiles/rails_6.0.gemfile - rvm: 2.4 - - gemfile: gemfiles/rails_6.1.gemfile - rvm: 2.4 - # Rails 5.2 isn't compatible with Ruby 3.0 or higher - - gemfile: gemfiles/rails_5.2.gemfile - rvm: 3.0 - -env: - global: - secure: LrTz0Pq2ibNZuKDhdzcrvEUSNxUpPopEq9aJeCxy3UpV0v4vpHBtWV0S6zofvf98g/RkZ6cGI1u+0H578dHgE6pWTo+iR8LAwqPKofrFIWRkeo+M77Vs5swahb3mQyPOcig1hfVWDm25MsojePYm70eBIcBU55NWImtdePXfiU0= diff --git a/README.md b/README.md index d9167d1..6520de7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Build Status](https://travis-ci.org/rpush/modis.svg?branch=master)](https://travis-ci.org/rpush/modis) [![Code Climate](https://codeclimate.com/github/ileitch/modis/badges/gpa.svg)](https://codeclimate.com/github/ileitch/modis) [![Test Coverage](https://codeclimate.com/github/ileitch/modis/badges/coverage.svg)](https://codeclimate.com/github/ileitch/modis) diff --git a/Rakefile b/Rakefile index d860faa..732f08f 100644 --- a/Rakefile +++ b/Rakefile @@ -10,9 +10,9 @@ RSpec::Core::RakeTask.new(:spec) do |spec| spec.rspec_opts = ['--backtrace'] end -if ENV['TRAVIS'] && ENV['QUALITY'] == 'false' +if ENV['CI'] && ENV['QUALITY'] == 'false' task default: 'spec' -elsif RUBY_VERSION > '1.9' && defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' +elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' task default: 'spec:quality' else task default: 'spec' diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile new file mode 100644 index 0000000..a334cb1 --- /dev/null +++ b/gemfiles/rails_7.0.gemfile @@ -0,0 +1,8 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activemodel", "~> 7.0.0" +gem "activesupport", "~> 7.0.0" + +gemspec path: "../" diff --git a/lib/tasks/quality.rake b/lib/tasks/quality.rake index a23c571..b0b63a0 100644 --- a/lib/tasks/quality.rake +++ b/lib/tasks/quality.rake @@ -1,7 +1,7 @@ # frozen_string_literal: true begin - if ENV['TRAVIS'] + if ENV['CI'] namespace :spec do task cane: ['spec'] end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ba06be2..181b82a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -unless ENV['TRAVIS'] +unless ENV['CI'] begin require './spec/support/simplecov_helper' include SimpleCovHelper # rubocop:disable Style/MixinUsage diff --git a/spec/support/simplecov_helper.rb b/spec/support/simplecov_helper.rb index 5094ecc..1f477a4 100644 --- a/spec/support/simplecov_helper.rb +++ b/spec/support/simplecov_helper.rb @@ -11,7 +11,7 @@ def start_simple_cov(name) formatters = [SimpleCov::Formatter::QualityFormatter] - if ENV['TRAVIS'] + if ENV['CI'] require 'codeclimate-test-reporter' formatters << CodeClimate::TestReporter::Formatter if CodeClimate::TestReporter.run? From 760b6537ee3699fb5323d0a9f6b2832f489fb14e Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Wed, 18 Jan 2023 08:25:10 -0300 Subject: [PATCH 5/5] Update appraisals to match what CI sees --- Appraisals | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Appraisals b/Appraisals index c52ba2b..762ea35 100644 --- a/Appraisals +++ b/Appraisals @@ -1,20 +1,5 @@ # frozen_string_literal: true -appraise 'rails-4.2' do - gem 'activemodel', '~> 4.2.0' - gem 'activesupport', '~> 4.2.0' -end - -appraise 'rails-5.0' do - gem 'activemodel', '~> 5.0.0' - gem 'activesupport', '~> 5.0.0' -end - -appraise 'rails-5.1' do - gem 'activemodel', '~> 5.1.0' - gem 'activesupport', '~> 5.1.0' -end - appraise 'rails-5.2' do gem 'activemodel', '~> 5.2.0' gem 'activesupport', '~> 5.2.0' @@ -24,3 +9,13 @@ appraise 'rails-6.0' do gem 'activemodel', '~> 6.0.0' gem 'activesupport', '~> 6.0.0' end + +appraise 'rails-6.1' do + gem 'activemodel', '~> 6.1.0' + gem 'activesupport', '~> 6.1.0' +end + +appraise 'rails-7.0' do + gem 'activemodel', '~> 7.0.0' + gem 'activesupport', '~> 7.0.0' +end