# Continuous Integration (CI)
Continuous Integration (CI) is a software development practice where developers frequently merge code changes into a shared repository, with each integration automatically verified by building the code and running tests. The goal is to detect integration problems early, when they're easier and cheaper to fix.
CI was popularized by [[Kent Beck]] as part of Extreme Programming (XP) in the late 1990s and has become a foundational practice in modern [[DevOps]]/[[DevSecOps]].
## Key Principles
- **Frequent commits**: Integrate changes at least daily
- **Automated builds**: Every commit triggers a build
- **Automated testing**: Run tests on every build
- **Fast feedback**: Developers know quickly if changes break something
- **Single source of truth**: One main branch everyone integrates to
## CI Workflow
```
Developer → Commit → Push → CI Server → Build → Test → Report
↓ ↓
Compile Unit/Integration
Package Lint/Security
```
## Benefits
- Early bug detection
- Reduced integration problems
- Always-working main branch
- Faster development cycles
- Improved code quality
- Team visibility into changes
## Popular CI Tools
- **[[GitHub]] Actions**: Native GitHub CI/CD
- **[[GitLab]] CI**: Built into GitLab
- **Jenkins**: Open source, self-hosted
- **CircleCI**: Cloud-native CI
- **Travis CI**: GitHub-integrated CI
- **Azure Pipelines**: Microsoft's CI service
## Best Practices
- Keep builds fast (under 10 minutes)
- Fix broken builds immediately
- Write comprehensive automated tests
- Use feature branches with short lifespans
- Review code before merging
## References
- https://en.wikipedia.org/wiki/Continuous_integration
- https://martinfowler.com/articles/continuousIntegration.html
## Related
- [[Continuous Delivery (CD)]]
- [[Continuous Deployment (CD)]]
- [[CI CD pipelines]]
- [[DevOps]]
- [[DevSecOps]]
- [[GitHub]]
- [[GitLab]]