Prerequisite | Importance | Notes |
---|---|---|
Experience with the command line | Necessary | Continuous integration will follow command line instructions |
Version control | Necessary | Continuous integration runs every time a new commit is made to your project |
Reproducible computational environments | Necessary | Continuous integration runs your tests on a separate computer (usually in the cloud) so you need to set it up in the same way. |
Testing | Very helpful | Continuous integration tests if anything important has changed when you make a change in your project |
Summary¶
Continuous integration (CI) is the practice of integrating changes to a project made by individuals into a main, shared version frequently (usually multiple times per day). CI software is also typically used to identify any conflicts and bugs that are introduced by changes, so they are found and fixed early, minimising the effort required to do so. Running tests regularly also saves humans from needing to do it manually. By making users aware of bugs as early as possible researchers (if the project is a research project) do not waste a lot of time doing work that may need to be thrown away, which may be the case if tests are run infrequently and results are produced using faulty code.
Figure 1:The Turing Way project illustration by Scriberia. Used under a CC-BY 4.0 licence. DOI: The Turing Way Community & Scriberia (2024).
Motivation and Background¶
CI has a number of key benefits:
- Helps bugs to be found early, minimising their damage and making them easier to fix
- Keeps project contributors up to date with each other’s work so they can benefit from it as soon as possible
- Encourages users to write tests
- Automates running of tests
- Ensures tests are run frequently
- The Turing Way Community, & Scriberia. (2024). Illustrations from The Turing Way: Shared under CC-BY 4.0 for reuse. Zenodo. 10.5281/ZENODO.3332807