Skip to content

Commit 8b854c2

Browse files
Support rails.7.2 & update CI to run on Ruby 3 x Rails 6 & 7 (#2)
* Support Rails 7.2 * Bumped ruby version requirement to 3.0.0 * Rubocop Ruby target as well * remove redundant sort * Update Rakefile * Update test/rails_test.rb * chore: update CI to run on Ruby 3 x Rails 6 & 7 (#3) * chore: add appraisal * update CI to run on ruby/rails matrix * continue on error * no need for dark magic rails test? * Fixed rubocop * don't use deprecated OpenStruct * exclude ruby head / rails 6.1 --------- Co-authored-by: Lud <[email protected]>
1 parent b25a3bd commit 8b854c2

File tree

12 files changed

+98
-87
lines changed

12 files changed

+98
-87
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,29 @@ on:
77
pull_request:
88

99
jobs:
10-
rspec:
10+
tests:
11+
name: "RSpec @ Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}"
1112
runs-on: ubuntu-latest
13+
continue-on-error: true
14+
env:
15+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
1216
strategy:
1317
matrix:
1418
ruby:
15-
- "3.0.7"
16-
- "3.1.5"
19+
- "3.1"
20+
- "3.3"
21+
- "head"
22+
rails:
23+
- "6.1"
24+
- "7.1"
25+
- "7.2"
26+
exclude:
27+
- ruby: "3.3"
28+
rails: "6.1"
29+
- ruby: "head"
30+
rails: "6.1"
1731
steps:
18-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
1933
- name: Set up Ruby
2034
uses: ruby/setup-ruby@v1
2135
with:
@@ -24,15 +38,20 @@ jobs:
2438
- name: Run rspec
2539
run: bundle exec rake test
2640

27-
rubocop:
41+
linters:
42+
name: "Rubocop @ Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}"
2843
runs-on: ubuntu-latest
44+
continue-on-error: true
45+
env:
46+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
2947
strategy:
3048
matrix:
3149
ruby:
32-
- "3.0.7"
33-
- "3.1.5"
50+
- "head"
51+
rails:
52+
- "7.2"
3453
steps:
35-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
3655
- name: Set up Ruby
3756
uses: ruby/setup-ruby@v1
3857
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
/tmp/
99
Gemfile.lock
1010
*.gem
11+
.ruby-version
12+
gemfiles/*.lock

.rubocop.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AllCops:
22
NewCops: enable
3-
TargetRubyVersion: 2.6
3+
TargetRubyVersion: 3.0
44

55
Style/ClassAndModuleChildren:
66
Exclude:
@@ -23,10 +23,6 @@ Style/TrailingCommaInHashLiteral:
2323
EnforcedStyleForMultiline: consistent_comma
2424
Style/AccessorGrouping:
2525
EnforcedStyle: separated
26-
Style/OpenStructUse:
27-
Exclude:
28-
- test/*_test.rb
29-
- test/**/*_test.rb
3026

3127
Layout/LineLength:
3228
Exclude:

Appraisals

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
SUPPORTED_RAILS_VERSIONS = %w[
4+
6.1
5+
7.1
6+
7.2
7+
].freeze
8+
9+
SUPPORTED_RAILS_VERSIONS.each do |version|
10+
appraise "rails-#{version}" do
11+
gem 'rails', "~> #{version}"
12+
end
13+
end

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ source 'https://rubygems.org'
55
# Specify your gem's dependencies in diffcrypt.gemspec
66
gemspec
77

8+
gem 'appraisal'
89
gem 'minitest', '~> 5.0'
910
gem 'minitest-reporters', '~> 1.6.0'
1011
gem 'rake', '~> 13.2'

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ end
1111
task default: :test
1212

1313
path = File.expand_path(__dir__)
14-
Dir.glob("#{path}/lib/diffcrypt/tasks/**/*.rake").sort.each { |f| load f }
14+
Dir.glob("#{path}/lib/diffcrypt/tasks/**/*.rake").each { load(_1) }

diffcrypt.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
1212
spec.description = 'Diffable encrypted configuration files that can be safely committed into a git repository'
1313
spec.homepage = 'https://github.com/diffcrypt/diffcrypt-ruby'
1414
spec.license = 'MIT'
15-
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
15+
spec.required_ruby_version = Gem::Requirement.new('>= 3.0.0')
1616

1717
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
1818

@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
2929
spec.executables = %w[diffcrypt]
3030
spec.require_paths = ['lib']
3131

32-
spec.add_runtime_dependency 'activesupport', '>= 6.0', '< 7.2'
32+
spec.add_runtime_dependency 'activesupport', '>= 6.0', '< 7.3'
3333
spec.add_runtime_dependency 'thor', '>= 0.20', '< 2'
3434
spec.metadata['rubygems_mfa_required'] = 'true'
3535
end

gemfiles/rails_6.1.gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# This file was generated by Appraisal
4+
5+
source 'https://rubygems.org'
6+
7+
gem 'appraisal'
8+
gem 'minitest', '~> 5.0'
9+
gem 'minitest-reporters', '~> 1.6.0'
10+
gem 'rails', '~> 6.1'
11+
gem 'rake', '~> 13.2'
12+
gem 'rubocop', '~> 1.25.1'
13+
gem 'simplecov', '~> 0.22.0', require: false
14+
gem 'simplecov-lcov', '< 0.9'
15+
16+
gemspec path: '../'

gemfiles/rails_7.1.gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# This file was generated by Appraisal
4+
5+
source 'https://rubygems.org'
6+
7+
gem 'appraisal'
8+
gem 'minitest', '~> 5.0'
9+
gem 'minitest-reporters', '~> 1.6.0'
10+
gem 'rails', '~> 7.1'
11+
gem 'rake', '~> 13.2'
12+
gem 'rubocop', '~> 1.25.1'
13+
gem 'simplecov', '~> 0.22.0', require: false
14+
gem 'simplecov-lcov', '< 0.9'
15+
16+
gemspec path: '../'

gemfiles/rails_7.2.gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# This file was generated by Appraisal
4+
5+
source 'https://rubygems.org'
6+
7+
gem 'appraisal'
8+
gem 'minitest', '~> 5.0'
9+
gem 'minitest-reporters', '~> 1.6.0'
10+
gem 'rails', '~> 7.2'
11+
gem 'rake', '~> 13.2'
12+
gem 'rubocop', '~> 1.25.1'
13+
gem 'simplecov', '~> 0.22.0', require: false
14+
gem 'simplecov-lcov', '< 0.9'
15+
16+
gemspec path: '../'

0 commit comments

Comments
 (0)