In this lesson, you will learn:
- what is CI
- how to trigger your code quality tools using CI
- the key Git and Github components required for CI
- how to configure GitHub Actions for CI
- examples and walk-throughs of the GitHub Actions/CI workflow.
Up until this point we have looked at how to run and automate our code quality checks locally. However, what would happen if someone in the team decided not to run any of these tools and to merge their code into the codebase? Well, the code quality of our production code would now be compromised. Not good!
Continuous Integration (CI)
A solution to this is to utilize continuous integration (CI). CI is a fancy term for:
multiple developers integrating their code, into a central codebase, with the addition of automated testing, to catch issues before their code is merged.
For the context of this course, we will use GitHub Actions for our CI workflow.
For those of you who are new to Git, let me provide a quick summary of Git, GitHub and the main components that will be key in our CI workflow.
- Git - Git is a local CLI-based version control system.
- GitHub - a centralized cloud-based collaboration and version control system.
- GitHub Actions - CI/CD platform for GitHub. In other words, it allows you to trigger workflows based upon a GitHub event. A centralized cloud-based collaboration and version control system.
- Branch - Git branches are used to create separate "copies" of our main (branch/) codebase. Development can then be performed on the branch in isolation without affecting the main branch.
- Commit - a saved change to your repository.
- Pull request - a PR is a request for merging one branch into another - for example, merging a feature branch into the main branch. When a PR is raised, tests can then be triggered and the required review be performed before the code is merged.