Skip to content

Commit 92db634

Browse files
committed
Add Rails 8 to build
1 parent 72d59aa commit 92db634

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424
- uses: ruby/setup-ruby@v1
2525
with:
26-
ruby-version: '3.0'
26+
ruby-version: '3.3'
2727
- run: script/update_rubygems_and_install_bundler
2828
- run: bundle install --standalone
2929
- run: bundle binstubs --all
@@ -44,6 +44,14 @@ jobs:
4444
env:
4545
RAILS_VERSION: 'main'
4646

47+
# Rails 8.0 builds >= 3.2
48+
- ruby: 3.3
49+
env:
50+
RAILS_VERSION: '~> 8.0.0'
51+
- ruby: 3.2
52+
env:
53+
RAILS_VERSION: '~> 8.0.0'
54+
4755
# Rails 7.2 builds >= 3.1
4856
- ruby: 3.3
4957
env:

Gemfile-rails-dependencies

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ def add_net_gems_dependency
1111
end
1212
end
1313

14-
def add_sqlite3_gem_dependency
15-
# sqlite3 is an optional, unspecified, dependency and Rails 6.0 only supports `~> 1.4`
14+
def add_sqlite3_gem_dependency(rails_version)
15+
# sqlite3 is an optional, unspecified, dependency and Rails 8.0 only supports `~> 2.0`
1616
if RUBY_VERSION.to_f < 3
1717
# sqlite3 1.7.x doesn't work on all platforms for Ruby 2.x
1818
gem 'sqlite3', '~> 1.4', '< 1.7', platforms: [:ruby]
19+
elsif rails_version.to_f >= 8
20+
gem 'sqlite3', '~> 2.0', platforms: [:ruby]
1921
else
20-
gem 'sqlite3', '~> 1.4', platforms: [:ruby]
22+
gem 'sqlite3', '~> 1.7', platforms: [:ruby]
2123
end
2224
end
2325

@@ -29,21 +31,12 @@ when /main/
2931
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
3032
gem 'selenium-webdriver', require: false
3133

32-
# Rails 8 requires 2.0.0
3334
gem 'sqlite3', '~> 2.0', platforms: [:ruby]
34-
when /stable$/
35-
gem_list = %w[rails railties actionmailer actionpack activerecord activesupport activejob actionview]
36-
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
37-
38-
gem_list.each do |rails_gem|
39-
gem rails_gem, :git => "https://github.com/rails/rails.git", :branch => version
40-
end
41-
add_sqlite3_gem_dependency
4235
when nil, false, ""
43-
gem "rails", "~> 7.0.0"
36+
gem "rails", "~> 8.0.0"
4437
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
4538
gem 'selenium-webdriver', require: false
46-
add_sqlite3_gem_dependency
39+
gem 'sqlite3', '~> 2.0', platforms: [:ruby]
4740
else
4841
version_number = version.split(' ').last
4942
add_net_gems_dependency if version_number < '7.0'
@@ -58,5 +51,5 @@ else
5851
else
5952
gem 'selenium-webdriver', require: false
6053
end
61-
add_sqlite3_gem_dependency
54+
add_sqlite3_gem_dependency(version_number)
6255
end

example_app_generator/generate_app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
elsif Rails::VERSION::STRING > '8'
3636
gsub_file "Gemfile", /.*gem..sqlite3.*/, "gem 'sqlite3', '~> 2.0'"
3737
else
38-
gsub_file "Gemfile", /.*gem..sqlite3.*/, "gem 'sqlite3', '~> 1.4'"
38+
gsub_file "Gemfile", /.*gem..sqlite3.*/, "gem 'sqlite3', '~> 1.7'"
3939
end
4040

4141
# remove webdrivers

0 commit comments

Comments
 (0)