Continuous Integration
The last topic ended on a one-word fix for integration hell: do it continuously. Continuous integration — almost always shortened to CI — means every change is merged back into the shared code and automatically checked, many times a day, while each change is still small. No waiting for a dreaded merge event; the merging and the checking happen constantly, in the background, on every commit.
Picture Maya saving a small commit to Pageturn. The instant she does, a machine springs into action: it assembles the app from the latest code, runs the app's tests, and reports back within minutes whether anything broke. She finds out her change is healthy — or that it isn't — while the work is still fresh in her mind. That fast, automatic check on every change is the whole idea, and here is what it looks like.
What continuous integration means
CI is two ideas welded together: integrate, and check — automatically, on every change. The integrate half is from the last topic: each small commit folds back into the shared code right away instead of piling up. The check half is new: a machine doesn't just accept the change, it immediately tries to build and test the app with that change included, and only then declares it healthy or broken.
The key word is automatically. No one remembers to run the checks, and no one can skip them when they're in a hurry. Every single change gets the same treatment, every time — which is exactly the consistency that hand-run steps could never guarantee.
What runs on every change
This is the pipeline idea from Chapter 2, pointed at integration. When a commit lands, an automated sequence runs in a fixed order: first build the app — assemble it from the latest code to confirm the pieces still fit — then run the tests, then report a single verdict, pass or fail. If the build or the tests fail, the line stops and Maya is told; nothing broken is allowed to slip quietly into the shared code.
Teams describe that sequence in a small text file that lives alongside the code, and the machine follows it. Here is a stripped-down example for Pageturn. It says: on every push of a change, run a job that has a few steps — install the tools the app depends on, build the app, and run the tests. That's the entire shape of it — a trigger at the top, then a short list of steps to run in order. You don't need to read it as code; the words in it are the same build-and-test steps the prose just described. You'll write real files like this yourself in the Git, GitHub & GitHub Actions course — here it's only an exhibit, to make the artifact concrete.
on: push
jobs:
test:
steps:
- run: install dependencies
- run: build the app
- run: run the tests
Why fast feedback changes everything
The payoff is speed of discovery. Because the check runs the moment a change is made, a problem is caught minutes after it's created — while the change is small, recent, and the only thing that could have caused it. Maya doesn't have to hunt; the break points straight at the few lines she just touched.
Compare that to finding the same bug weeks later, mixed in with hundreds of other changes. A problem caught early is cheap to fix; the same problem caught late is expensive, because it's buried and because work has piled on top of it. Tightening that gap from weeks to minutes is the entire reason CI is worth the setup.
What CI is not
One careful distinction, because it trips up almost everyone: CI checks a change, but it does not ship it to users. Building and testing Pageturn on every commit tells the team the change is healthy — actually releasing that change to readers is a separate practice called continuous delivery, the subject of Chapter 8. CI is the gate; delivery is the door.
Nor does CI replace the human review from Chapter 3. The machine checks that the code builds and the tests pass; a teammate still reads the change for judgment a test can't capture. The two run side by side. When you reach the Git, GitHub & GitHub Actions course, the file above is exactly the kind of thing you'll write to set this gate up for real.
- "CI ships the change to users." It doesn't. CI builds and tests the change to confirm it's healthy; putting it in front of users is continuous delivery, a separate practice you'll meet in Chapter 8.
- "CI is one specific product you buy." CI is a practice — integrate and check on every change. Many different tools can run it; the idea is what matters, not any single brand.
- "CI replaces human code review." No — they catch different things and run together. The machine checks that it builds and passes tests; a person checks the judgment and intent a test can't see.
- "A failed check just gets skipped so work can continue." The opposite — a failed build or test stops the line and tells the developer, so a known-broken change can't quietly enter the shared code.
- CI is the first automated gate of the pipeline, and it's running in nearly every real software team — the file above is something you'll genuinely see at work.
- It turns "did my change break anything?" from a weeks-late surprise into a minutes-fast answer, which is what makes shipping small and often actually safe.
- Knowing CI checks but doesn't ship clears up the single most common mix-up between CI and CD before you reach Chapter 8.
- The little workflow file is the direct on-ramp to the Git, GitHub & GitHub Actions course, where you'll write one yourself.
Knowledge Check
What does continuous integration do every time a change is made?
- Builds and tests each integrated change automatically
- Releases the change straight out to all of the real users automatically
- Waits for a teammate to read and approve it by hand
- Saves the change up to check once at the end of the week
Why is catching a problem through CI so much cheaper than catching it weeks later?
- The change is small and fresh, so the cause is easy to find
- CI makes it impossible to ever write a bug in the first place
- It means hiring more people to watch the code by hand
- It quietly hides failures so the team isn't slowed down
A teammate says "our CI passed, so the change is now live for users." What's the correction?
- CI only checks the change is healthy; shipping it is a separate step
- A passing CI run actually means nothing at all about the code
- CI never runs the checks until someone manually releases the change to users first
- Passing CI is the same thing as a teammate approving the code
You got correct