Skip to content

Commit b1d0d7d

Browse files
chore: update CI to run on Ruby 3 x Rails 6 & 7 (#3)
* chore: add appraisal * update CI to run on ruby/rails matrix * no need to have test lockfiles in repo * fix typo and cleanup * continue on error * no need for dark magic rails test? * Fixed rubocop --------- Co-authored-by: Mohammed Abdulkareem <HorizonDragon@outlook.com> Co-authored-by: Mohammed Abdulkareem <mohd@hey.com>
1 parent 84d2487 commit b1d0d7d

File tree

8 files changed

+89
-78
lines changed

8 files changed

+89
-78
lines changed

.github/workflows/test.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,27 @@ 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"
1729
steps:
18-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
1931
- name: Set up Ruby
2032
uses: ruby/setup-ruby@v1
2133
with:
@@ -24,15 +36,20 @@ jobs:
2436
- name: Run rspec
2537
run: bundle exec rake test
2638

27-
rubocop:
39+
linters:
40+
name: "Rubocop @ Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}"
2841
runs-on: ubuntu-latest
42+
continue-on-error: true
43+
env:
44+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
2945
strategy:
3046
matrix:
3147
ruby:
32-
- "3.0.7"
33-
- "3.1.5"
48+
- "head"
49+
rails:
50+
- "7.2"
3451
steps:
35-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
3653
- name: Set up Ruby
3754
uses: ruby/setup-ruby@v1
3855
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

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'

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: '../'

test/rails_test.rb

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)