Skip to content

Commit c073b91

Browse files
Add newer versions of Ruby and Rails to CI matrix (#176)
This PR adds Ruby 3.1 and 3.2 as well as Rails 6.1 and 7.0 to the CI matrix. As part of these changes we also: 1. Added `fail-fast: false` to the CI configuration to enable easier debugging 2. Removed the lockfiles so that dependencies can be rebuilt using current gems 3. Updated the rspec less than 3.10 requirement to be `~> 3.9.0` as opposed to `< 3.10.0` so that the `rspec-rails` requirement doesn't pull in a very old rspec 4. Removed the cache action and gem installation in the GitHub action configuration and instead used the bundler-cache functionality built into `ruby/setup-ruby` 5. Added Rails 6.1 and Rails 7.0 appraisals, but only for RSpec >= 3.10 (as `rspec-rails` prior to 5.0.0 did not support Rails 6.1, and `rspec-rails` requires at least `rspec` 3.10) 6. Only load `pry-byebug` / `pry-nav` for Ruby versions < 3.2 7. Correct the Rails 6.0 Appraisals entry and the corresponding gemfiles to use `~> 6.0.0` Co-authored-by: Anton Rieder <aried3r@gmail.com>
1 parent a96b616 commit c073b91

26 files changed

+124
-2103
lines changed

.github/workflows/super_diff.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
test:
1717
runs-on: ubuntu-20.04
1818
strategy:
19+
fail-fast: false
1920
matrix:
2021
ruby:
2122
- 2.5
@@ -26,10 +27,15 @@ jobs:
2627
- rails_5_1
2728
- rails_5_2
2829
- rails_6_0
30+
- rails_6_1
2931
- no_rails
3032
rspec_appraisal:
3133
- rspec_lt_3_10
3234
- rspec_gte_3_10
35+
exclude:
36+
- rails_appraisal: rails_6_1
37+
rspec_appraisal: rspec_lt_3_10
38+
3339
env:
3440
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
3541
JAVA_OPTS: "--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.io=org.jruby.dist"
@@ -40,26 +46,36 @@ jobs:
4046
uses: ruby/setup-ruby@v1
4147
with:
4248
ruby-version: ${{ matrix.ruby }}
43-
- uses: actions/cache@v3
44-
with:
45-
path: vendor/bundle
46-
key: v1-rubygems-local-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles(format('gemfiles/{0}_{1}.gemfile.lock', matrix.rails_appraisal, matrix.rspec_appraisal)) }}
47-
- name: Install dependencies
48-
run: bin/ci/install
49+
bundler-cache: true
4950
- name: Run tests
5051
run: bin/ci/run-tests
5152
test_ruby_3:
5253
runs-on: ubuntu-20.04
5354
strategy:
55+
fail-fast: false
5456
matrix:
5557
ruby:
5658
- '3.0'
59+
- '3.1'
60+
- '3.2'
5761
rails_appraisal:
5862
- rails_6_0
63+
- rails_6_1
64+
- rails_7_0
5965
- no_rails
6066
rspec_appraisal:
6167
- rspec_lt_3_10
6268
- rspec_gte_3_10
69+
exclude:
70+
- ruby: 3.2
71+
rails_appraisal: rails_6_0
72+
- ruby: 3.2
73+
rails_appraisal: rails_6_1
74+
- rails_appraisal: rails_6_1
75+
rspec_appraisal: rspec_lt_3_10
76+
- rails_appraisal: rails_7_0
77+
rspec_appraisal: rspec_lt_3_10
78+
6379
env:
6480
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
6581
JAVA_OPTS: "--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.io=org.jruby.dist"
@@ -70,11 +86,6 @@ jobs:
7086
uses: ruby/setup-ruby@v1
7187
with:
7288
ruby-version: ${{ matrix.ruby }}
73-
- uses: actions/cache@v3
74-
with:
75-
path: vendor/bundle
76-
key: v1-rubygems-local-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles(format('gemfiles/{0}_{1}.gemfile.lock', matrix.rails_appraisal, matrix.rspec_appraisal)) }}
77-
- name: Install dependencies
78-
run: bin/ci/install
89+
bundler-cache: true
7990
- name: Run tests
8091
run: bin/ci/run-tests

Appraisals

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,22 @@ appraisals = {
3131
rails_6_0: proc {
3232
instance_eval(&rails_dependencies)
3333

34-
gem "activerecord", "~> 6.0"
35-
gem "railties", "~> 6.0"
34+
gem "activerecord", "~> 6.0.0"
35+
gem "railties", "~> 6.0.0"
36+
gem "sqlite3", "~> 1.4.0", platform: [:ruby, :mswin, :mingw]
37+
},
38+
rails_6_1: proc {
39+
instance_eval(&rails_dependencies)
40+
41+
gem "activerecord", "~> 6.1.0"
42+
gem "railties", "~> 6.1.0"
43+
gem "sqlite3", "~> 1.4.0", platform: [:ruby, :mswin, :mingw]
44+
},
45+
rails_7_0: proc {
46+
instance_eval(&rails_dependencies)
47+
48+
gem "activerecord", "~> 7.0.0"
49+
gem "railties", "~> 7.0.0"
3650
gem "sqlite3", "~> 1.4.0", platform: [:ruby, :mswin, :mingw]
3751
},
3852
no_rails: proc {},
@@ -66,6 +80,11 @@ end
6680

6781
if Gem::Requirement.new(">= 2.5.0").satisfied_by?(Gem::Version.new(RUBY_VERSION))
6882
rails_appraisals << :rails_6_0
83+
rails_appraisals << :rails_6_1
84+
end
85+
86+
if Gem::Requirement.new(">= 2.7.0").satisfied_by?(Gem::Version.new(RUBY_VERSION))
87+
rails_appraisals << :rails_7_0
6988
end
7089

7190
rspec_appraisals = [
@@ -80,6 +99,8 @@ rails_appraisals.each do |rails_appraisal|
8099
instance_eval(&appraisals.fetch(rails_appraisal))
81100
instance_exec(false, &appraisals.fetch(rspec_appraisal))
82101
end
102+
elsif %i(rails_6_1 rails_7_0).include?(rails_appraisal) && rspec_appraisal == :rspec_lt_3_10
103+
next
83104
else
84105
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
85106
instance_eval(&appraisals.fetch(rails_appraisal))

gemfiles/no_rails.gemfile.lock

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

gemfiles/no_rails_rspec_gte_3_10.gemfile.lock

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

gemfiles/no_rails_rspec_lt_3_10.gemfile.lock

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

0 commit comments

Comments
 (0)