Skip to content

Commit f6760ac

Browse files
Test with Rails main (#207)
This adds gemfiles for Rails `main` branch so that CI can provide early warnings regarding compatibility with the upcoming version of Rails. The corresponding `Gemfile.lock` files are excluded from version control since they would quickly become stale.
1 parent 3f8980c commit f6760ac

File tree

6 files changed

+66
-1
lines changed

6 files changed

+66
-1
lines changed

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ jobs:
1414
- Gemfile
1515
- gemfiles/rails_7_0_propshaft.gemfile
1616
- gemfiles/rails_7_1_propshaft.gemfile
17+
- gemfiles/rails_main_propshaft.gemfile
1718
- gemfiles/rails_7_0_sprockets.gemfile
1819
- gemfiles/rails_7_1_sprockets.gemfile
20+
- gemfiles/rails_main_sprockets.gemfile
1921
continue-on-error: [ false ]
2022

2123
name: ${{ format('Tests (Ruby {0}, {1})', matrix.ruby-version, matrix.gemfile) }}
@@ -30,7 +32,7 @@ jobs:
3032

3133
- name: Remove Gemfile lock
3234
run: |
33-
rm $BUNDLE_GEMFILE.lock
35+
rm -f $BUNDLE_GEMFILE.lock
3436
3537
- name: Install Ruby
3638
uses: ruby/setup-ruby@v1

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
/test/dummy/public/assets
2121
.byebug_history
2222
*.gem
23+
24+
# Ignore Gemfile.lock files for Rails main branch.
25+
/gemfiles/rails_main*.gemfile.lock

Appraisals

+10
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ appraise "rails_7_1_propshaft" do
1717
gem "rails", "~> 7.1.0"
1818
gem "propshaft"
1919
end
20+
21+
appraise "rails_main_sprockets" do
22+
gem "rails", github: "rails/rails", branch: "main"
23+
gem "sprockets-rails"
24+
end
25+
26+
appraise "rails_main_propshaft" do
27+
gem "rails", github: "rails/rails", branch: "main"
28+
gem "propshaft"
29+
end

gemfiles/rails_main_propshaft.gemfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", branch: "main", git: "https://github.com/rails/rails.git"
6+
gem "sqlite3"
7+
gem "propshaft"
8+
9+
group :development do
10+
gem "appraisal"
11+
end
12+
13+
group :test do
14+
gem "turbo-rails"
15+
gem "stimulus-rails"
16+
gem "byebug"
17+
gem "rexml"
18+
gem "capybara"
19+
gem "selenium-webdriver"
20+
gem "webdrivers"
21+
end
22+
23+
gemspec path: "../"

gemfiles/rails_main_sprockets.gemfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", branch: "main", git: "https://github.com/rails/rails.git"
6+
gem "sqlite3"
7+
gem "sprockets-rails"
8+
9+
group :development do
10+
gem "appraisal"
11+
end
12+
13+
group :test do
14+
gem "turbo-rails"
15+
gem "stimulus-rails"
16+
gem "byebug"
17+
gem "rexml"
18+
gem "capybara"
19+
gem "selenium-webdriver"
20+
gem "webdrivers"
21+
end
22+
23+
gemspec path: "../"

test/installer_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def with_new_rails_app
4646
gemfile = File.read("Gemfile")
4747
gemfile.gsub!(/^gem "importmap-rails".*/, "")
4848
gemfile << %(gem "importmap-rails", path: #{File.expand_path("..", __dir__).inspect}\n)
49+
if Rails::VERSION::PRE == "alpha"
50+
gemfile.gsub!(/^gem "rails".*/, "")
51+
gemfile << %(gem "rails", path: #{Gem.loaded_specs["rails"].full_gem_path.inspect}\n)
52+
end
4953
File.write("Gemfile", gemfile)
5054

5155
run_command("bundle", "install")

0 commit comments

Comments
 (0)