Git & GitHub Interview Question #92
What is CI and how does GitHub Actions support it?
GitHub Collaboration, Repository Rules, Issues, Releases & Actions CI/CD Mid-Level Intermediate
Quick Interview Answer
Continuous Integration, or CI, is the practice of integrating changes frequently and automatically validating them with repeatable checks such as builds and tests.
Detailed Explanation
Continuous Integration, or CI, is the practice of integrating changes frequently and automatically validating them with repeatable checks such as builds and tests.
GitHub Actions can implement CI by running validation whenever code is pushed or a pull request is opened or updated. This provides fast feedback and helps prevent known build or test failures from reaching protected branches.
Code Example
on:
pull_request:
branches: [ main ]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: dotnet test