Skip to content

Commit c10a0aa

Browse files
authored
Merge pull request #2472 from alphagov/update-rails-config-defaults
Update Rails config to 8.1 via bin/rails app:update
2 parents 9ff060b + f0a5587 commit c10a0aa

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

bin/ci

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
require_relative "../config/boot"
3+
require "active_support/continuous_integration"
4+
5+
CI = ActiveSupport::ContinuousIntegration
6+
require_relative "../config/ci.rb"

bin/rubocop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require "rubygems"
33
require "bundler/setup"
44

5-
# explicit rubocop config increases performance slightly while avoiding config confusion.
5+
# Explicit RuboCop config increases performance slightly while avoiding config confusion.
66
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
77

88
load Gem.bin_path("rubocop", "rubocop")

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
module TravelAdvicePublisher
2323
class Application < Rails::Application
2424
# Initialize configuration defaults for originally generated Rails version.
25-
config.load_defaults 8.0
25+
config.load_defaults 8.1
2626

2727
# Please, add to the `ignore` list any other `lib` subdirectories that do
2828
# not contain `.rb` files, or that should not be reloaded or eager loaded.

config/ci.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Run using bin/ci
2+
3+
CI.run do
4+
step "Setup", "bin/setup --skip-server"
5+
6+
step "Style: Ruby", "bin/rubocop"
7+
8+
step "Security: Importmap vulnerability audit", "bin/importmap audit"
9+
step "Security: Brakeman code analysis", "bin/brakeman --quiet --no-pager --exit-on-warn --exit-on-error"
10+
step "Tests: Rails", "bin/rails test"
11+
12+
# Optional: Run system tests
13+
# step "Tests: System", "bin/rails test:system"
14+
15+
# Optional: set a green GitHub commit status to unblock PR merge.
16+
# Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
17+
# if success?
18+
# step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
19+
# else
20+
# failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
21+
# end
22+
end

0 commit comments

Comments
 (0)