diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4a70c8..cf3b044 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,19 +16,27 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.2', '3.3', '3.4'] - rails: ['7.1.0', '7.2.0', '8.0.0'] + ruby: ['3.3', '3.4', '4.0'] + rails: ['7.2.0', '8.0.0', '8.1.0'] activeadmin: ['3.2.0', '3.3.0', '3.4.0', '3.5.1'] exclude: + # ActiveAdmin 3.2.0 predates Rails 8 support. - rails: '8.0.0' activeadmin: '3.2.0' + - rails: '8.1.0' + activeadmin: '3.2.0' include: + # ActiveAdmin 4 requires railties >= 7.2, so cover its floor and the + # newest supported Rails releases. - ruby: '3.4' rails: '7.2.0' activeadmin: '4.0.0.beta22' - ruby: '3.4' rails: '8.0.0' activeadmin: '4.0.0.beta22' + - ruby: '3.4' + rails: '8.1.0' + activeadmin: '4.0.0.beta22' env: RAILS: ${{ matrix.rails }} AA: ${{ matrix.activeadmin }} diff --git a/Gemfile b/Gemfile index c80ec8a..f9bdef1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'https://rubygems.org' gemspec -default_rails_version = '7.1.0' -default_activeadmin_version = '3.2.0' +default_rails_version = '8.0.0' +default_activeadmin_version = '3.5.1' # `~> 4.0.0.beta22` would admit 4.0.0 GA — pin prereleases exactly so the # CI cell tests the AA build it claims to test. diff --git a/active_admin_import.gemspec b/active_admin_import.gemspec index 196cc63..2e694cb 100644 --- a/active_admin_import.gemspec +++ b/active_admin_import.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |gem| gem.summary = 'ActiveAdmin import based on activerecord-import gem.' gem.homepage = 'https://github.com/activeadmin-plugins/active_admin_import' gem.license = 'MIT' - gem.required_ruby_version = '>= 3.1.0' + gem.required_ruby_version = '>= 3.3.0' gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR) gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) } gem.name = 'active_admin_import' diff --git a/tasks/test.rake b/tasks/test.rake index 8c74714..e07f606 100644 --- a/tasks/test.rake +++ b/tasks/test.rake @@ -24,7 +24,16 @@ task :setup do ) # v4 drops sprockets-rails (see Gemfile), so skip the asset pipeline to # avoid the auto-generated `config/initializers/assets.rb` crashing at boot. - rails_new_opts.unshift('--skip-asset-pipeline') if aa_v4 + if aa_v4 + rails_new_opts.unshift('--skip-asset-pipeline') + else + # Rails 8.1 wires importmap-rails into the generated ApplicationController + # (`stale_when_importmap_changes`). The AA 3 app uses Sprockets, not + # importmap, so that gem is absent and the controller raises NameError at + # boot. Skip JavaScript so the macro is never generated — the specs run on + # rack_test and never execute JS anyway. + rails_new_opts.unshift('--skip-javascript') + end system "bundle exec rails new spec/rails/#{TestAppPaths.app_dir_name} #{rails_new_opts.join(' ')}" end