class method self.run

Ruby on Rails 8.1.2

Since v8.1.2

Signature

self.run(title = "Continuous Integration", subtitle = "Running tests, style checks, and security audits", &block)

Perform a CI run. Execute each step, show their results and runtime, and exit with a non-zero status if there are any failures.

Pass an optional title, subtitle, and a block that declares the steps to be executed.

Sets the CI environment variable to “true” to allow for conditional behavior in the app, like enabling eager loading and disabling logging.

Example:

ActiveSupport::ContinuousIntegration.run do
  step "Setup", "bin/setup --skip-server"
  step "Style: Ruby", "bin/rubocop"
  step "Security: Gem audit", "bin/bundler-audit"
  step "Tests: Rails", "bin/rails test test:system"

  if success?
    step "Signoff: Ready for merge and deploy", "gh signoff"
  else
    failure "Skipping signoff; CI failed.", "Fix the issues and try again."
  end
end

Parameters

title opt = "Continuous Integration"
subtitle opt = "Running tests
style checks req
and security audits" req
block block
Source
# File activesupport/lib/active_support/continuous_integration.rb, line 55
    def self.run(title = "Continuous Integration", subtitle = "Running tests, style checks, and security audits", &block)
      new.tap do |ci|
        ENV["CI"] = "true"
        ci.heading title, subtitle, padding: false
        ci.report(title, &block)
        abort unless ci.success?
      end
    end

Defined in activesupport/lib/active_support/continuous_integration.rb line 55 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::ContinuousIntegration

Type at least 2 characters to search.

↑↓ navigate · open · esc close