Skip to content

Commit e4bba8c

Browse files
authored
Improve and fix CI (#439)
* Add Ruby3.4 to CI matrix * Upgrade actions/checkout to the latest version * Fix the CI failure on Ruby versions below 2.7 When using older Rails together with concurrent-ruby version 1.3.5 or higher, Rails fails to start as shown. I addressed this by using a concurrent-ruby version below 1.3.5. ``` ruby test/timecop_with_active_support_test.rb /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:16:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError) from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:9:in `<module:ActiveSupport>' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:8:in `<top (required)>' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger_silence.rb:5:in `require' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger_silence.rb:5:in `<top (required)>' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger.rb:3:in `require' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/logger.rb:3:in `<top (required)>' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support.rb:29:in `require' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support.rb:29:in `<top (required)>' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/all.rb:3:in `require' from /home/runner/work/timecop/timecop/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.10/lib/active_support/all.rb:3:in `<top (required)>' from test/timecop_with_active_support_test.rb:4:in `require' from test/timecop_with_active_support_test.rb:4:in `<main>' ``` * Fix the CI failure on Ruby 3.5 When running CI on Ruby 3.5, it fails as shown. As the error message indicates, rdoc was removed from the standard library, which caused the tests to fail. I fixed this by adding rdoc to the Gemfile. ``` /home/runner/work/timecop/timecop/Rakefile:4: warning: rdoc/task is found in rdoc, which is not part of the default gems since Ruby 3.5.0. You can add rdoc to your Gemfile or gemspec to fix this error. rake aborted! LoadError: cannot load such file -- rdoc/task (LoadError) /home/runner/work/timecop/timecop/Rakefile:4:in '<top (required)>' /home/runner/work/timecop/timecop/vendor/bundle/ruby/3.5.0+4/gems/rake-13.3.1/exe/rake:27:in '<top (required)>' /home/runner/.rubies/ruby-head/bin/bundle:25:in '<main>' (See full trace by running task with --trace) ```
1 parent d695c6f commit e4bba8c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/CI.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
matrix:
1717
ruby:
1818
- head
19+
- '3.4'
1920
- '3.3'
2021
- '3.2'
2122
- '3.1'
@@ -30,7 +31,7 @@ jobs:
3031
continue-on-error: ${{ matrix.ruby == 'head' }}
3132
name: Ruby ${{ matrix.ruby }}
3233
steps:
33-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v5
3435
- uses: ruby/setup-ruby@v1
3536
with:
3637
ruby-version: ${{ matrix.ruby }}

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ group :development do
1212
gem 'i18n'
1313
gem 'minitest'
1414
end
15+
16+
gem 'rdoc'
17+
gem 'concurrent-ruby', '< 1.3.5' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')

0 commit comments

Comments
 (0)