Skip to content

Commit

Permalink
Update version support: Rails >= 5.2, Ruby >= 2.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
maiwald committed Mar 21, 2024
1 parent 3002c3e commit 5b8533c
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 24 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@ jobs:
strategy:
matrix:
ruby:
- '2.3.x'
- '2.4.x'
- '2.5.x'
- '2.6.x'
rails:
- '5.0.7.2'
- '5.1.7'
- '5.2.3'
- '2.7.8'
- '3.0.6'
appraisal:
- 'rails-5.2'
- 'rails-6.0'
- 'rails-6.1'
exclude:
- ruby: '3.0.6'
appraisal: 'rails-5.2'
steps:
- name: Install system dependencies
run: sudo apt-get install -y libsqlite3-dev
- uses: actions/checkout@master
- name: Setup ruby
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
architecture: 'x64'
- run: gem install bundler && bundle && bundle exec rake
env:
AR_TEST_VERSION: ${{ matrix.rails }}

- name: Install bundle
run: bundle
- name: Install appraisal
run: bundle exec appraisal install
- name: Run tests
run: bundle exec appraisal ${{ matrix.appraisal }} rspec
11 changes: 11 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
appraise 'rails-5.2' do
gem 'rails', '5.2.8.1'
end

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

appraise 'rails-6.1' do
gem 'rails', '6.1.7.7'
end
13 changes: 7 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ namespace :db do
end
end

require 'rubocop/rake_task'
RuboCop::RakeTask.new do |t|
t.options = ['-d']
end
# TODO: add rubocop
# require 'rubocop/rake_task'
# RuboCop::RakeTask.new do |t|
# t.options = ['-d']
# end

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:rspec) do |t|
Expand All @@ -37,7 +38,7 @@ task :pandoc do
system('pandoc -s -r markdown -w rst README.md -o README.rst')
end

task publish: %i[pandoc rubocop rspec] do
task publish: %i[pandoc rspec] do # TODO: add rubocop
# Ensure the gem builds
system('gem build permanent_records.gemspec') &&
# And we didn't leave anything (aside from the gem) uncommitted
Expand All @@ -46,4 +47,4 @@ task publish: %i[pandoc rubocop rspec] do
system("gem push permanent_records-#{version}.gem")
end

task default: %i[rspec rubocop]
task default: %i[rspec] # TODO: add rubocop
1 change: 1 addition & 0 deletions gemfiles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gemfile.lock
7 changes: 7 additions & 0 deletions gemfiles/rails_5.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "5.2.8.1"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "6.0.6.1"

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "6.1.7.7"

gemspec path: "../"
9 changes: 5 additions & 4 deletions permanent_records.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'activesupport', ver || '>= 5.0.0'
s.add_development_dependency 'database_cleaner', '>= 1.5.1'
s.add_development_dependency 'pry-byebug'
s.add_development_dependency 'rake' # For Travis-ci
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', '>= 3.5.0'
s.add_development_dependency 'rubocop', '~> 0.68.0' # freeze to ensure ruby 2.2 compatibility
s.add_development_dependency 'rubocop-performance'
s.add_development_dependency 'sqlite3', '~> 1.3.13' # freeze to ensure specs are working
# s.add_development_dependency 'rubocop'
# s.add_development_dependency 'rubocop-performance'
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'appraisal'
end

0 comments on commit 5b8533c

Please sign in to comment.