diaspora_federation/test/dummy/config/application.rb
Benjamin Neff 3dbf0488dd
Allow to test for multiple rails versions in CI
Before we only tested with the latest rails version and without rails,
that made it possible to accidentally break with older rails versions
without noticing it.

The old way of keeping separate Gemfiles (and lockfiles) was too
complicated to keep up to date, especially with many supported rails
versions. This allows now to run with different rails version with just
the same Gemfile using an env-var.

For CI the Gemfile.lock is only used for the latest rails version (7.0
at the moment), as it obviously doesn't fit for other versions. I think
that's fine, as if we are not compatible with a too new version of
something, we need to add a maximum version there anyway.

The `ruby/setup-ruby@v1` step automatically uses the deployment mode
when a Gemfile.lock is present, so the `BUNDLE_FROZEN` env-var is not
required, even if a Gemfile.lock is used.
2023-06-11 18:41:20 +02:00

37 lines
1.2 KiB
Ruby

# frozen_string_literal: true
require_relative "boot"
require "rails"
# Pick the frameworks you want:
# require "active_model/railtie"
# require "active_job/railtie"
# require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
# require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
# require "action_cable/engine"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
require "diaspora_federation/rails"
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults(ENV["RAILS_VERSION"] || "7.0")
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
end
end