Slide 1

Slide 1 text

Local CI × GitHub Actions Hybrid CI That Plays to the Strengths of Both @gogutan Kaigi on Rails 2026

Slide 2

Slide 2 text

About me @gogutan Tech Lead @ Catal Inc. Hobbies: English, competitive programming (AtCoder), watching baseball, mahjong

Slide 3

Slide 3 text

Catallog Learning management system for children studying English Students log their daily study on tablets and see their growth https://catal.jp/

Slide 4

Slide 4 text

Another talk from our team Emiko Ando (@siroemk) Day 1, 15:50–16:05 @ Lime Hall Modeling Catallog with our school staff, starting from Google Sheets

Slide 5

Slide 5 text

Our CI took about 10 minutes • A Rails app with ~150 models, built by 8 engineers

Slide 6

Slide 6 text

Our CI took about 10 minutes • A Rails app with ~150 models, built by 8 engineers • CI on GitHub Actions: ~10 min for every review request

Slide 7

Slide 7 text

Our CI took about 10 minutes • A Rails app with ~150 models, built by 8 engineers • CI on GitHub Actions: ~10 min for every review request • AI costs are rising → we want to cut other SaaS costs

Slide 8

Slide 8 text

Rails 8.1: Local CI ActiveSupport::ContinuousIntegration

Slide 9

Slide 9 text

Why not run CI on your own machine? • “Dev laptops are super fast these days. They're chronically underutilized. And you already own them.” — basecamp/gh-signoff https://github.com/basecamp/gh-signoff

Slide 10

Slide 10 text

10m 39s → 1m 57s

Slide 11

Slide 11 text

GitHub Actions already runs jobs in parallel

Slide 12

Slide 12 text

Not a replacement, but a hybrid • Even a modest laptop is fast enough

Slide 13

Slide 13 text

Not a replacement, but a hybrid • Even a modest laptop is fast enough fi • Local CI + GitHub Actions, each where it ts

Slide 14

Slide 14 text

Not a replacement, but a hybrid • Even a modest laptop is fast enough • Local CI + GitHub Actions, each where it ts fi • After ~6 months: GitHub Actions runs halved (406 → 197/mo)

Slide 15

Slide 15 text

Today • 1. Setting up Local CI • 2. Making it fast • 3. Using GitHub Actions alongside • 4. Should we unify on bin/ci?

Slide 16

Slide 16 text

1. Setting up Local CI

Slide 17

Slide 17 text

bin/ci and con g/ci.rb • Generated by rails new (Rails 8.1) fi • bin/ci just loads config/ci.rb

Slide 18

Slide 18 text

con g/ci.rb • A simple DSL • step "title", "command" fi • Runs from top to bottom

Slide 19

Slide 19 text

A summary with timings at the end

Slide 20

Slide 20 text

Replace the steps with your own fi • Static analysis rst, then tests

Slide 21

Slide 21 text

gh signo • Runs only when all steps pass f • Adds one green check, signoff, to the commit

Slide 22

Slide 22 text

“This commit passed CI on my machine”

Slide 23

Slide 23 text

Make signo the only required check ff Using rulesets? gh signoff install sets this up for you

Slide 24

Slide 24 text

No green check for untested code

Slide 25

Slide 25 text

But you could still sign o by hand # without running bin/ci… ff • $ gh signoff

Slide 26

Slide 26 text

One signo for the whole CI • “A single signoff is all you need for most projects.” — basecamp/gh-signoff https://github.com/basecamp/gh-signoff ff • Easier to combine with GitHub Actions (later)

Slide 27

Slide 27 text

2. Making it fast

Slide 28

Slide 28 text

① As is • All steps in series • RSpec in a single process

Slide 29

Slide 29 text

① As is: 4m 57s

Slide 30

Slide 30 text

② + parallel_rspec • RSpec has no built-in parallelism • parallel_tests: 8 processes, 8 test databases

Slide 31

Slide 31 text

② 4m 57s → 2m 57s

Slide 32

Slide 32 text

Still, many steps use only one core

Slide 33

Slide 33 text

③ group (Rails 8.2) • Backported early: only one require line changed

Slide 34

Slide 34 text

③ + group • Sub-groups run in parallel • Steps inside a sub-group run in order

Slide 35

Slide 35 text

③ 2m 57s → 1m 57s

Slide 36

Slide 36 text

Keep a multi-core step running at all times

Slide 37

Slide 37 text

Keep a multi-core step running at all times

Slide 38

Slide 38 text

4m 57s → 2m 57s → 1m 57s

Slide 39

Slide 39 text

3. Where do we still use GitHub Actions?

Slide 40

Slide 40 text

3 cases Local CI can't cover • 1. Merging to main: the last line of defense (it also triggers our staging build)

Slide 41

Slide 41 text

3 cases Local CI can't cover • 1. Merging to main: the last line of defense (it also triggers our staging build) • 2. Dependabot PRs: about 60 a month

Slide 42

Slide 42 text

3 cases Local CI can't cover • 1. Merging to main: the last line of defense (it also triggers our staging build) • 2. Dependabot PRs: about 60 a month • 3. Manual runs: when your machine is busy

Slide 43

Slide 43 text

Keep the jobs, limit when they run • Push to main • Dependabot PRs • Manual runs

Slide 44

Slide 44 text

Two paths

Slide 45

Slide 45 text

Two paths

Slide 46

Slide 46 text

ff Only signo is required…

Slide 47

Slide 47 text

f Add a job that sets signo

Slide 48

Slide 48 text

cloud-ci-signo • Waits for the 5 jobs with needs f • Then sets signoff through the API

Slide 49

Slide 49 text

ff A Dependabot PR: signed o by Cloud CI

Slide 50

Slide 50 text

Gotcha: skipped jobs count as success • “A job that is skipped will report its status as "Success". It will not prevent a pull request from merging, even if it is a required check.” — GitHub Docs fl fl https://docs.github.com/en/actions/how-tos/write-work ows/choose-when-work ows-run/control-jobs-with-conditions

Slide 51

Slide 51 text

Don't name the job signo • Name it differently f • Set signoff explicitly, only on success

Slide 52

Slide 52 text

bin/cloud-ci • Start GitHub Actions in one command, just like bin/ci

Slide 53

Slide 53 text

4. Why not run bin/ci on GitHub Actions too?

Slide 54

Slide 54 text

Run bin/ci on GitHub Actions • The Rails docs say bin/ci can run in the cloud too • “…can be run either locally or in the cloud.” — Rails API docs https://api.rubyonrails.org/classes/ ActiveSupport/ContinuousIntegration.html • So we tried it

Slide 55

Slide 55 text

We tried it

Slide 56

Slide 56 text

bin/ci is tuned to scale up

Slide 57

Slide 57 text

Larger runners: faster and a bit cheaper

Slide 58

Slide 58 text

Still, we keep them separate fi • Needs cloud-speci c tuning

Slide 59

Slide 59 text

Still, we keep them separate • Needs cloud-speci c tuning fi • Larger runners aren't covered by free minutes

Slide 60

Slide 60 text

Still, we keep them separate • Needs cloud-speci c tuning • Larger runners aren't covered by free minutes fi • One job: harder to see what failed, no per-job re-runs

Slide 61

Slide 61 text

Still, we keep them separate • Needs cloud-speci c tuning • Larger runners aren't covered by free minutes • One job: harder to see what failed, no per-job re-runs fi • → Not worth forcing them into one

Slide 62

Slide 62 text

Summary • Local CI + gh signoff: 10m 39s → about 2 min

Slide 63

Slide 63 text

Summary • Local CI + gh signoff: 10m 39s → about 2 min • GitHub Actions covers the rest, all ending in one signoff

Slide 64

Slide 64 text

Summary • Local CI + gh signoff: 10m 39s → about 2 min • GitHub Actions covers the rest, all ending in one signoff • Unifying on bin/ci is possible, but not worth forcing

Slide 65

Slide 65 text

Provide sharp knives • “Ruby includes a lot of sharp knives in its drawer of features. Not by accident, but by design.” — The Rails Doctrine https://rubyonrails.org/doctrine#provide-sharp-knives

Slide 66

Slide 66 text

Local CI is a sharp knife • Everyone gets the power to turn things green

Slide 67

Slide 67 text

Local CI is a sharp knife • Everyone gets the power to turn things green • No big problems so far

Slide 68

Slide 68 text

Local CI is a sharp knife • Everyone gets the power to turn things green • No big problems so far • No more waiting 10 minutes after opening a PR

Slide 69

Slide 69 text

Local CI is fast because we trust each other