Skip to content

Commit 261bea6

Browse files
lcreidgithub-actions
and
github-actions
authored
Run tests locally (bootstrap-ruby#736)
* WIP * Rebase on another branch * Changed in CI Please review the changes in the files in this commit carefully, as they were automatically generated during CI. Run `git pull` to bring the changes into your local branch. Then, if you do not want the changes, run `git revert HEAD`. * Update gemfiles for gems not in Ruby 3.4 --------- Co-authored-by: github-actions <[email protected]>
1 parent bd4b153 commit 261bea6

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.yarnrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# yarn lockfile v1
33

44

5-
lastUpdateCheck 1709415989700
5+
lastUpdateCheck 1718162593302

Rakefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,26 @@ desc 'Run RuboCop checks'
2828
RuboCop::RakeTask.new(:rubocop)
2929

3030
task default: %i[test rubocop:autocorrect]
31+
32+
namespace :test do
33+
desc "Run tests for all supported Rails versions, with current Ruby version"
34+
task :all do
35+
original_directory = Dir.pwd
36+
original_gemfile = ENV["BUNDLE_GEMFILE"]
37+
gemfiles = Dir.glob("gemfiles/*.gemfile").reject { |f| File.basename(f) == "common.gemfile" }
38+
gemfiles.each do |f|
39+
ENV["BUNDLE_GEMFILE"] = f
40+
system("bundle check") || system("bundle install")
41+
system("bundle exec rake test")
42+
end
43+
44+
Dir.chdir("demo")
45+
ENV.delete("BUNDLE_GEMFILE")
46+
system("bundle check") || system("bundle install")
47+
system("bundle exec rake test:all")
48+
49+
ensure
50+
original_gemfile.nil? ? ENV.delete("BUNDLE_GEMFILE") : ENV["BUNDLE_GEMFILE"] = original_gemfile
51+
Dir.chdir(original_directory)
52+
end
53+
end

gemfiles/6.1.gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ eval File.read(gems), binding, gems # rubocop: disable Security/Eval
44
gem "bigdecimal" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
55
gem "drb" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
66
gem "mutex_m" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
7+
gem "base64" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
8+
gem "logger" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
79
gem "rails", "~> 6.1.0"
810
gem "sqlite3", "~> 1.4"

gemfiles/7.0.gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eval File.read(gems), binding, gems # rubocop: disable Security/Eval
44
gem "bigdecimal" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
55
gem "drb" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
66
gem "mutex_m" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
7+
gem "base64" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
8+
gem "logger" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
79
gem "rails", "~> 7.0.2"
810
gem "sqlite3", "~> 1.4"
911
gem "sprockets-rails", require: "sprockets/railtie"

0 commit comments

Comments
 (0)