Skip to content

Commit

Permalink
Introduce appraisals gem
Browse files Browse the repository at this point in the history
Problem: Nowadays, tzu is only tested agains rails 4. We must automate
the tests against all the versions above 4.

Solution: Introduce appraisals gem to automate the tests agains
different versions of Rails
  • Loading branch information
stac47 committed Jan 5, 2024
1 parent 1ce2bef commit 5eedb70
Show file tree
Hide file tree
Showing 14 changed files with 700 additions and 20 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Ruby

on:
Expand All @@ -10,27 +11,28 @@ jobs:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
bundler-cache: true
- name: Linter
run: bundle exec rake standard
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
bundler-cache: true
- name: Linter
run: bundle exec rake standard
test:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
fail-fast: false
matrix:
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3' ]
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
rails: ['4', '5', '6', '7']
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run specs
run: bundle exec rake
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run specs
run: bundle exec appraisal rails-${{ matrix.rails }} rake
15 changes: 15 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appraise "rails-4" do
gem "activemodel", "4.2.11.3"
end

appraise "rails-5" do
gem "activemodel", "5.2.8.1"
end

appraise "rails-6" do
gem "activemodel", "~> 6.1"
end

appraise "rails-7" do
gem "activemodel", "~> 7.1"
end
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source "http://rubygems.org"

gemspec

gem "activemodel", "4.2.11.3"
gem "activemodel"
gem "debug"
gem "irb"
gem "rake"
Expand All @@ -11,3 +11,5 @@ gem "rubocop-rspec"
gem "rubocop-rake"
gem "standard"
gem "virtus"

gem "appraisal", "~> 2.5"
8 changes: 7 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
Expand Down Expand Up @@ -109,6 +113,7 @@ GEM
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.1)
stringio (3.1.0)
thor (1.3.0)
thread_safe (0.3.6)
tzinfo (1.2.11)
thread_safe (~> 0.1)
Expand All @@ -122,7 +127,8 @@ PLATFORMS
ruby

DEPENDENCIES
activemodel (= 4.2.11.3)
activemodel
appraisal (~> 2.5)
debug
irb
rake
Expand Down
16 changes: 16 additions & 0 deletions gemfiles/rails_4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "activemodel", "4.2.11.3"
gem "debug"
gem "irb"
gem "rake"
gem "rspec"
gem "rubocop-rspec"
gem "rubocop-rake"
gem "standard"
gem "virtus"
gem "appraisal", "~> 2.5"

gemspec path: "../"
143 changes: 143 additions & 0 deletions gemfiles/rails_4.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
PATH
remote: ..
specs:
tzu (1.0.0)
activesupport

GEM
remote: http://rubygems.org/
specs:
activemodel (4.2.11.3)
activesupport (= 4.2.11.3)
builder (~> 3.1)
activesupport (4.2.11.3)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
builder (3.2.4)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.2.2)
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.5.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
io-console (0.7.1)
irb (1.11.0)
rdoc
reline (>= 0.3.8)
json (2.7.1)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
minitest (5.20.0)
parallel (1.24.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
psych (5.1.2)
stringio
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.8.3)
reline (0.4.1)
io-console (~> 0.5)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.59.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.25.0)
rubocop (~> 1.33)
rubocop-performance (1.20.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.26.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
standard (1.33.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.59.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.3.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.1)
stringio (3.1.0)
thor (1.3.0)
thread_safe (0.3.6)
tzinfo (1.2.11)
thread_safe (~> 0.1)
unicode-display_width (2.5.0)
virtus (2.0.0)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)

PLATFORMS
arm64-darwin-22

DEPENDENCIES
activemodel (= 4.2.11.3)
appraisal (~> 2.5)
debug
irb
rake
rspec
rubocop-rake
rubocop-rspec
standard
tzu!
virtus

BUNDLED WITH
2.4.22
16 changes: 16 additions & 0 deletions gemfiles/rails_5.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "activemodel", "5.2.8.1"
gem "debug"
gem "irb"
gem "rake"
gem "rspec"
gem "rubocop-rspec"
gem "rubocop-rake"
gem "standard"
gem "virtus"
gem "appraisal", "~> 2.5"

gemspec path: "../"
Loading

0 comments on commit 5eedb70

Please sign in to comment.