Skip to content

Commit

Permalink
Add CI for Rails 7.2
Browse files Browse the repository at this point in the history
Additionally, add an exclude for main since it bumped the ruby version
  • Loading branch information
Earlopain committed Nov 1, 2024
1 parent e9548a3 commit 60e0453
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ jobs:
fail-fast: false
matrix:
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3', 'head', 'truffleruby' ]
rails: [ '6.1', '7.0', '7.1', 'main' ]
rails: [ '6.1', '7.0', '7.1', '7.2', 'main' ]
exclude:
- ruby: '2.7'
rails: '7.2'
- ruby: '3.0'
rails: '7.2'
- ruby: '2.7'
rails: 'main'
- ruby: '3.0'
rails: 'main'
- ruby: '3.1'
rails: 'main'

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
Expand Down
6 changes: 6 additions & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source "https://rubygems.org"

gem "activemodel", "~> 7.2.0"
gem "railties", "~> 7.2.0"

gemspec path: "../"
11 changes: 10 additions & 1 deletion test/cases/railtie_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@ class Application < Rails::Application; end

class RailtieTest < ActiveSupport::TestCase
include ActiveSupport::Testing::Isolation
# Not every Rails version introduces a new version
KNOWN_CACHE_FORMATS = {
6.1 => 6.1,
7.0 => 7.0,
7.1 => 7.1,
7.2 => 7.1,
8.0 => 7.1,
}
KNOWN_CACHE_FORMATS.default = 7.1

def setup
Rails.env = 'development'
@app = BlogApp::Application.new
@app.config.eager_load = false
@app.config.logger = Logger.new(nil)
@app.config.secret_key_base = ('x' * 30)
@app.config.active_support.cache_format_version = Rails::VERSION::STRING.to_f
@app.config.active_support.cache_format_version = KNOWN_CACHE_FORMATS[Rails::VERSION::STRING.to_f]
end

test 'GlobalID.app for Blog::Application defaults to blog' do
Expand Down

0 comments on commit 60e0453

Please sign in to comment.