Continuous integration
Definition
Continuous integration (CI) is the practice of merging every developer's code changes into the shared main branch frequently — at least daily — and running automated builds and tests on each merge to detect integration problems early.
Grady Booch first used the term 'continuous integration' in 1991, but Kent Beck made it a formal practice in Extreme Programming (XP) in the late 1990s. The original XP rule: never let the build break overnight. If a build breaks, the team stops new work until it's fixed.
CI solves the 'integration hell' that plagues infrequent integration: when developers work in isolation for days or weeks and then try to merge, conflicts compound. The longer the isolation, the more painful the merge. CI makes integration a tiny, frequent, automatable event rather than a large, terrifying project milestone.
What CI requires:
- A shared mainline. Everyone commits to the same branch (or merges to it frequently via short-lived feature branches).
- An automated build. Every commit triggers a build that confirms the code compiles and packages correctly.
- Automated tests. Unit tests run on every build; integration tests run on merge to main.
- Fast feedback. The build must be fast enough that developers don't go do something else while they wait. Ten-minute build is the XP benchmark.
- A culture of fixing breaks immediately. CI only works if a red build is treated as the team's top priority.
CI tools include GitHub Actions, GitLab CI, Jenkins, CircleCI, and BuildKite. CI pipelines get drawn on whiteboards during DevOps architecture sessions — the pipeline diagram (push → build → test → artifact → downstream) is a standard subject.
Examples
- GitHub Actions: on push to any branch, run lint, unit tests, and build; on merge to main, also run integration tests
- Trunk-based development: developers commit to main multiple times per day via short-lived branches; CI runs on every push
- Monorepo CI: detect which packages changed and run only the affected tests, keeping the build under five minutes
- Test pyramid: 500 unit tests (2 min), 100 integration tests (8 min), 20 end-to-end tests (gated to daily)
Related terms
Snap a continuous integration. Ship its actions.
BoardSnap turns any whiteboard — including this one — into a summary and action plan.