diff --git a/.github/workflows/gouteur.yml b/.github/workflows/gouteur.yml index fee6259..bf73e1e 100644 --- a/.github/workflows/gouteur.yml +++ b/.github/workflows/gouteur.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.3 - name: Prepare run: | bundle install --jobs 4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 45f1ac7..68147c8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.3 - name: Cache gems uses: actions/cache@v1 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d35cb67..eb5763e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - ruby: [ '2.3', '2.7', '3.0', '3.1', 'ruby-head', 'jruby-head' ] + ruby: [ '2.4', '2.7', '3.0', '3.1', '3.2', '3.3', 'ruby-head', 'jruby-head' ] steps: - uses: actions/checkout@v2 @@ -25,4 +25,4 @@ jobs: - name: Test with Rake run: bundle exec rake - uses: codecov/codecov-action@v3 - if: matrix.ruby == '2.7' + if: matrix.ruby == '3.2' diff --git a/Gemfile b/Gemfile index dc31acc..c22a3cf 100644 --- a/Gemfile +++ b/Gemfile @@ -7,14 +7,15 @@ gemspec gem 'benchmark-ips', '~> 2.7' gem 'get_process_mem', '~> 0.2.3' -gem 'rake', '~> 13.0' +gem 'rake', '~> 13.1' gem 'rake-compiler', '~> 1.1' gem 'range_compressor', '~> 1.0' gem 'regexp_parser', '~> 2.9' gem 'regexp_property_values', '~> 1.5' gem 'rspec', '~> 3.8' -if RUBY_VERSION.to_f >= 2.7 +gem 'warning', '~> 1.3' +if RUBY_VERSION.to_f >= 3.0 gem 'gouteur', '~> 1.0.0' gem 'rubocop', '~> 1.59' - gem 'simplecov-cobertura' + gem 'simplecov-cobertura', require: false end diff --git a/spec/character_set/ractor_compatibility_spec.rb b/spec/character_set/ractor_compatibility_spec.rb index 86f0b25..0ab86ce 100644 --- a/spec/character_set/ractor_compatibility_spec.rb +++ b/spec/character_set/ractor_compatibility_spec.rb @@ -1,4 +1,6 @@ -describe CharacterSet, if: defined?(Ractor) do +# skip ractor test when evaluating coverage +# https://github.com/simplecov-ruby/simplecov/issues/1058 +describe CharacterSet, if: defined?(Ractor) && !defined?(SimpleCov) do it 'can be used with Ractor' do shared_instance = CharacterSet[97, 98, 99].freeze CharacterSet.const_set('RactorTestFrozen', shared_instance) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 909439e..eccc6ea 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,16 +1,16 @@ -if ENV['CI'] && RUBY_VERSION.start_with?('2.7') +require 'bundler/setup' +Dir[File.join(__dir__, 'support', '*.rb')].sort.each { |file| require file } + +if ENV['CI'] && RUBY_VERSION.start_with?('3.2') require 'simplecov' require 'simplecov-cobertura' SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter SimpleCov.start end -require 'bundler/setup' require 'character_set' require 'character_set/pure' -Dir[File.join(__dir__, 'support', '*.rb')].sort.each { |file| require file } - RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" diff --git a/spec/support/flush_default_ractor_warning.rb b/spec/support/flush_default_ractor_warning.rb deleted file mode 100644 index 49d2091..0000000 --- a/spec/support/flush_default_ractor_warning.rb +++ /dev/null @@ -1,4 +0,0 @@ -previous_verbose = $VERBOSE -$VERBOSE = nil -defined?(Ractor) && Ractor.new { nil } -$VERBOSE = previous_verbose diff --git a/spec/support/silence_default_ractor_warning.rb b/spec/support/silence_default_ractor_warning.rb new file mode 100644 index 0000000..e59c5d5 --- /dev/null +++ b/spec/support/silence_default_ractor_warning.rb @@ -0,0 +1,2 @@ +require 'warning' +Warning.ignore(/Ractor is experimental/)