Skip to content

Commit

Permalink
Improve special Rails version test for config rails load_defaults v…
Browse files Browse the repository at this point in the history
…ersion from ENV.
  • Loading branch information
huacnlee committed Oct 6, 2023
1 parent d6a9577 commit edb6eeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,28 @@ jobs:
- ruby: 3.2
gemfile: Gemfile
postgres: 10
rails_version: 7.1
- ruby: 3.2
gemfile: gemfiles/Gemfile-7-0
postgres: 10
rails_version: 7.0
- ruby: 2.7
gemfile: gemfiles/Gemfile-6-1
postgres: 10
rails_version: 6.1
- ruby: 2.6
gemfile: gemfiles/Gemfile-6-0
postgres: 10
rails_version: 6.0
- ruby: 2.6
gemfile: gemfiles/Gemfile-5-2
postgres: 10
rails_version: 5.0

env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
USE_OFFICIAL_GEM_SOURCE: 1
RAILS_VERSION: ${{ matrix.rails_version }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.0
config.load_defaults ENV.fetch("RAILS_VERSION", "7.1").to_f

# Configuration for the application, engines, and railties goes here.
#
Expand Down
3 changes: 3 additions & 0 deletions test/dummy/config/database.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
default: &default
host: localhost
port: 54321
user: postgres
adapter: postgresql
timeout: 5000
encoding: utf-8
Expand Down

0 comments on commit edb6eeb

Please sign in to comment.