Continuous Integration Basics
Setting up automated tests and checks that run on every change, as a backstop beyond your own review of AI-generated code.
Continuous Integration Basics
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Continuous integration means every push or pull request automatically triggers a defined set of checks — tests, linting, a build — instead of relying on someone remembering to run them locally.
- A CI pipeline is built from workflows, jobs, and triggers; the trigger decides when it runs, the jobs decide what runs, and each job is a sequence of steps executed on a fresh machine.
- CI catching a regression before it merges is strictly cheaper than catching it in production, because the fix happens while the context is still in your head and nothing live is broken yet.
- CI matters more, not less, once a meaningful share of changes come from an AI agent — it's an automated check that doesn't get tired, skim, or trust the diff just because it "looks reasonable".
- The exact YAML syntax for a given CI tool shifts over time even though the underlying concepts (workflow, job, trigger) don't; always sanity-check action versions against current docs rather than copying a tutorial verbatim.
Automating the thing you’d otherwise forget to do
Continuous integration is the practice of running your tests, linters, and build automatically every time code changes, rather than trusting that someone will remember to run them before merging. The appeal isn’t exotic — it’s that humans are inconsistent under deadline pressure, and a machine that runs the same checks every single time isn’t. CI turns “I should really run the test suite before merging this” into something that just happens, unconditionally, in the background.
The shape of a pipeline: triggers, jobs, steps
Most CI systems, GitHub Actions included, boil down to the same three concepts. A trigger is the event that starts a run — a push to a branch, a new pull request, a nightly schedule. A job is a unit of work, often run on its own fresh virtual machine, and a pipeline can have several jobs running in parallel (lint in one, test in another, build in a third). Inside a job, steps run in order: check out the code, install dependencies, run the test command, maybe upload a build artifact. Once you can read a pipeline as “this event triggers these jobs, each running these steps,” the YAML stops looking mysterious and starts looking like a recipe.
Why this backstop matters more now
Code review catches a lot, but review is a human activity with a human’s limits — attention fades, a large diff gets skimmed instead of read, and a plausible-looking change can pass a tired reviewer’s eye without being correct. This is exactly the failure mode that gets worse as more of your codebase is produced by directing an AI agent rather than typing it yourself: the output is often fluent and confident-looking regardless of whether it’s actually right. CI doesn’t care how confident the code looks. It runs the test suite, and the test suite either passes or it doesn’t. That’s a check an AI-generated diff has to pass on the same terms as anything else.
Catching regressions where they’re cheap to fix
The real economic argument for CI is timing. A bug caught while a pull request is open costs you a few minutes: you still remember exactly what you changed and why, nothing has shipped, and the fix is a quick follow-up commit. The same bug caught by a user in production costs vastly more — you’re reconstructing context from scratch, a real person had a broken experience, and you may be debugging under pressure. CI exists specifically to move that discovery moment as early as possible, before the change ever reaches anyone who isn’t looking at a pull request.
A caveat on syntax, not on substance
Tutorials and crash courses on CI tools age in a particular way: the concepts (triggers, jobs, steps, caching dependencies) stay stable for years, but the exact syntax for referencing a prebuilt action, and which version of it to pin, drifts as the ecosystem updates. If you’re following an older walkthrough and copying an action reference like actions/checkout@v2, it’s worth a quick check against the current docs for whether a newer major version exists before you commit to it — the shape of the pipeline you’re building won’t change, just that one line.
Starting small
You don’t need a sophisticated pipeline on day one. A single workflow that runs your test suite on every pull request is already a meaningful upgrade over nothing, and it’s the piece most teams reach for first. Linting, build verification, and deployment steps are natural things to layer on once that first job is running reliably — each one is just another job triggered by the same event.
Check yourself
What are the three core building blocks of a CI pipeline?
Triggers (what event starts the pipeline, like a push or a pull request), jobs (the units of work that run, often in parallel), and steps (the ordered commands inside a job, such as installing dependencies, running tests, and building).
Why is catching a bug in CI cheaper than catching it after deployment?
In CI the change hasn't shipped yet, the author still has full context on what they just changed, and nothing live is affected — fixing it is a quick iteration. After deployment, real users are already affected and the original context has often faded.
Why does CI become more valuable, not less, when a lot of code comes from an AI coding agent?
An agent's diff can look plausible without being correct, and manual review can miss subtle regressions. CI runs the same objective checks every time regardless of who or what produced the change, catching what a quick skim might not.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.