Skip to content

Commit

Permalink
Merge pull request #668 from petergoldstein/feature/add_rails_7_and_r…
Browse files Browse the repository at this point in the history
…uby_3_1

Add Rails 7 and Ruby 3.1 and 3.2 to the CI matrix.
  • Loading branch information
semmons99 authored Apr 6, 2023
2 parents a069f57 + 3acaf1b commit 5fac874
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0']
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
mongodb-version: ['4.4']
sqlite-version: ['3.0']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
Expand Down
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ task :prepare_test_env do
end

def run_with_gemfile(gemfile)
Bundler.with_clean_env do
Bundler.with_original_env do
begin
sh "BUNDLE_GEMFILE='#{gemfile}' bundle install --quiet"
Rake.application['app:db:create'].invoke
Expand All @@ -62,6 +62,12 @@ namespace :spec do
next if framework == 'mongoid' || (framework == 'rails' && version == "5")
end

# Skip Rails 7 unless the Ruby version is at least 2.7
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')
next if framework == 'rails' && version == "7"
end


frameworks_versions[framework] ||= []
frameworks_versions[framework] << file_name

Expand Down
17 changes: 17 additions & 0 deletions gemfiles/rails7.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source 'https://rubygems.org'

gem 'rails', '~> 7.0.0'
gem 'sprockets-rails'
gem 'i18n', '~> 1.6'

platforms :jruby do
gem "activerecord-jdbc-adapter"
gem "activerecord-jdbcsqlite3-adapter"
gem "jruby-openssl"
end

platforms :ruby do
gem "sqlite3", "~> 1.4"
end

gemspec path: '../'

0 comments on commit 5fac874

Please sign in to comment.