Skip to content

Commit 592c825

Browse files
committed
Add Rails 8.1 style local CI via bin/ci
1 parent 95b9c7a commit 592c825

3 files changed

Lines changed: 40 additions & 0 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/herb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
3+
require "bundler/setup"
4+
require "herb"
5+
6+
Herb::CLI.new(ARGV).call

config/ci.rb

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

0 commit comments

Comments
 (0)