What is CI (continuous integration)?
Continuous integration means merging code changes often and automatically building and testing each one. What CI does, how checks appear on pull requests, and why it matters.
On this page
Continuous integration, or CI, is the practice of merging code changes into a shared codebase frequently, with every change automatically built and tested. A CI system runs those builds and tests whenever code is pushed or a pull request is opened, and reports the results as pass or fail. It catches problems early, while changes are small, instead of all at once before a release.
What CI does
Every time a developer pushes changes, the CI system typically:
- Gets the latest code for that branch or pull request.
- Builds it, to make sure it compiles or bundles.
- Runs tests, from fast unit tests to slower integration tests.
- Runs other checks, such as linting, type checking or security scans.
- Reports results back to the code platform, where they appear as checks.
CI on pull requests
On GitHub, CI results show up as status checks on each pull request: green for passing, red for failing, yellow or grey for running. Repositories can require certain checks to pass before a pull request can merge. GitHub Actions is GitHub's built-in CI system, but many other CI services report to GitHub in the same way. See GitHub Actions and status checks, explained.
Why teams use CI
- Early feedback: you learn within minutes that a change broke something.
- Smaller problems: frequent integration means conflicts and bugs are found while they're small.
- Confidence: a passing build and test suite means the main branch works.
- Less manual testing for routine checks, freeing people for exploratory testing.
CI and code review
CI and code review complement each other. CI catches what machines are good at: broken builds, failing tests, style violations. Reviewers focus on what humans are good at: design, correctness in context and readability. When checks run before review, reviewers don't waste time on code that doesn't build. See what is code review?
CI and CD
CI is often paired with CD, which can mean continuous delivery (every passing change is ready to release) or continuous deployment (every passing change is released automatically). CI is the foundation: you can't safely release often without automated checks.
When CI fails
A failing check means something needs attention: a test broke, the build failed, or a check found a problem. Sometimes the cause is unrelated, such as a flaky test or a problem on the main branch. The first step is always to read the failing check's log. See what to do when CI checks fail on a pull request.
An example
A developer opens a pull request that changes how dates are formatted. Within a few minutes, CI reports "12 checks · 1 failing": a test for a report in another time zone broke. The developer reads the log, sees the edge case they missed, fixes it and pushes again. The checks go green, a reviewer approves, and the change merges. Without CI, that bug might have reached users.
Good CI habits
- Keep the build fast, so feedback arrives while you're still in context.
- Fix failures on the main branch immediately; everyone's work depends on it.
- Fix or quarantine flaky tests, so a red check always means something.
- Make important checks required before merging.
CI status at a glance
Waiting for CI often means refreshing a browser tab. OneNotch shows a check summary for each of your pull requests in the Mac's notch, such as "3 of 12 checks running" or "12 checks · 1 failing", and lists the checks with failing ones first and links to their logs. A notch preview when CI fails is on OneNotch's roadmap, not available yet.
FAQs
What does CI stand for?
Continuous integration.
Is GitHub Actions a CI tool?
Yes. GitHub Actions can run CI workflows, among other automation.
What's a status check?
A pass, fail or pending result reported on a commit or pull request, often by CI.
How often should code be integrated?
At least daily is a common goal; many teams merge small changes several times a day.