local_ci_plus improves Rails local CI for both developers and agents with parallel execution, fail-fast, resume, and plain output.
parallel.mp4
Add to your Gemfile:
gem "local_ci_plus"Then run:
bundle installlocal_ci_plus overrides ActiveSupport::ContinuousIntegration when it is loaded, so the default Rails bin/ci
continues to work without changes. In plain/non-TTY mode, output is ASCII-only.
bin/ciUse parallel_steps when you want a parallel phase before sequential follow-up steps.
If any step in parallel_steps fails, later steps are skipped and listed in the summary.
If no parallel_steps block is present, all steps run in parallel (default behavior).
CI.run do
parallel_steps do
step "Style: Ruby", "bin/standardrb"
step "JavaScript: lint", "npm run lint"
step "Security: Gem audit", "bin/bundler-audit"
end
step "Tests: Rails", "bin/rspec"
step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
endIf your app does not already require the gem in bin/ci, run the installer generator:
bin/rails generate local_ci_plus:installIf you already have a bin/ci and want to patch it in place, run:
bin/rails generate local_ci_plus:updateIf you want to edit bin/ci manually, add require "local_ci_plus" right after the boot file:
#!/usr/bin/env ruby
require_relative "../config/boot"
require "local_ci_plus"
require_relative "../config/ci"Runs all CI steps in parallel by default.
-f, --fail-fast Stop immediately when a step fails (runs inline)
-c, --continue Resume from the last failed step (runs inline)
-fc, -cf Combine fail-fast and continue
-i, --inline Run steps sequentially instead of parallel
--plain Disable ANSI cursor updates/colors (also used for non-TTY)
-h, --help Show this help
By default, the first failing step is stored in tmp/ci_state. Set CI_STATE_FILE to override the path. To reset the resume point, delete the file.
Run tests:
bundle exec ruby -Itest test/continuous_integration_test.rbRun linting:
bundle exec standardrbOr run them both:
bin/ci- Bump the version in
lib/local_ci_plus/version.rb. - Build and push:
gem build local_ci_plus.gemspec
gem push local_ci_plus-X.Y.Z.gemThis project is based off of ActiveSupport::ContinuousIntegration.
Many thanks to the Rails team for shipping the original work.