Continuous Integration: What a Pipeline Actually Is
Take one task-board application from local tests to a real delivery pipeline: continuous integration fundamentals, push and pull-request quality gates, lint, type-check, unit, component and end-to-end gates, dependency caching, matrix builds, artifacts and checksums, secrets and supply-chain security, release promotion, staging and production, rollback and observability.
What you will be able to do
#- Describe a pipeline as a triggered sequence of stages that each answer one question.
- Distinguish jobs, steps and runners.
- State accurately what the browser sandbox can and cannot execute.
Overview
#Two ideas behind CI
Continuous integration is a practice: every change is merged into a shared branch frequently, and every merge is verified automatically. Continuous delivery extends it so a verified change can be released at any time. A pipeline is the automation that enforces those practices.
A pipeline is a sequence of stages triggered by an event. A typical stage graph:
- Trigger: a push, a pull request, a tag or a schedule.
- Checkout: fetch the exact commit under test.
- Setup: install the runtime and dependencies.
- Build: compile, bundle or transpile.
- Verify: lint, type-check, unit, component and end-to-end tests.
- Package: produce an artifact.
- Gate: require approval or an environment rule.
- Deploy: publish to an environment.
- Observe: health checks, smoke tests and alerts.
Each stage answers one question and fails loudly when the answer is no. A stage that cannot fail is not a gate.
Jobs, steps and runners
A workflow runs on a runner, a machine that executes jobs. A job is a group of steps that share a workspace. Steps run in order and usually stop the job on the first failure. Jobs can run in parallel or wait on dependencies. Runners can be hosted by the provider or self-hosted.
name: ci
on:
pull_request:
push:
branches: [main]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable
- run: pnpm install --frozen-lockfile
- run: pnpm lint && pnpm check-types && pnpm test
The browser sandbox is not a CI runner
The FrontendX playground executes JavaScript and TypeScript in the browser using QuickJS and esbuild-wasm. That sandbox can run a pure function, a small assertion or a transpiled module. It cannot launch a native Node process, install Playwright browsers, run Docker, connect to a real database driver or execute a hosted CI runner. When an exercise asks for a workflow file, the file is authored configuration, not something the browser sandbox runs. Labeling a browser run as a native pipeline pass is inaccurate.
Determinism
A pipeline is only useful if the same commit produces the same result. Pin tool versions, install from a lockfile, avoid network calls in tests and avoid hidden state between runs. A pipeline that passes only on a warm cache is not a gate; it is a coincidence.
Exercises
#Reference answers and expected output are authored, not executed in this browser. Nothing you type is run, and there is no Run or Pass control on this page.
Exercise 1Predict
A workflow file has a jobs section but no top-level on key. When does it run?
Exercise 2Explain
Explain why a pipeline stage that can never fail is not a gate.
Reveal the reference answer
reference.textA gate is a check that blocks progress when a condition is not met. If a stage cannot fail, it cannot block anything, so it provides no protection. It is reporting or decoration, not a gate.Authored expected output: A correct answer states that a gate must be able to fail and block progress.
Gates derive their value from the failure they can produce. A stage with no failing condition cannot protect the branch or the release.
Exercise 3Implement
Write a workflow named ci that runs on pull_request and on push to main, checks out the code, sets up Node 20, enables corepack, installs with a frozen lockfile and runs lint and tests.
starter.yamlname: ci on: # add triggers jobs: verify: # add runner and stepsReveal the reference answer
reference.yamlname: ci on: pull_request: push: branches: [main] jobs: verify: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - run: corepack enable - run: pnpm install --frozen-lockfile - run: pnpm lint && pnpm testAuthored expected output: A workflow with pull_request and push triggers, a verify job on ubuntu-latest, and steps for checkout, Node setup, install and verification.
The frozen lockfile makes the install reproducible. The job fails on the first failing command, so lint or tests block the run. This file is authored configuration; the browser sandbox does not execute it.
Exercise 4Debug
This workflow fails to start because the job has no runner. Add the missing field.
starter.yamlname: ci on: [push] jobs: verify: steps: - run: echo helloReveal the reference answer
reference.yamlname: ci on: [push] jobs: verify: runs-on: ubuntu-latest steps: - run: echo helloAuthored expected output: The verify job declares runs-on: ubuntu-latest and the workflow is schedulable.
Every job must declare where it runs. Without runs-on the platform cannot allocate a machine and the workflow is invalid.
Common misconceptions
#- CI is a product you install rather than a practice you adopt.
- A green pipeline proves the product is correct.
- The browser sandbox can run the same commands as a hosted runner.
Follow-up practice
#- cicd-02-push-pr-quality-gates
Your progress
#Answers, drafts and completion marks are stored only in this browser. Nothing is sent to a server and no account is used.
Verification: authored. Answers and outputs on this page are authored reference material, not executed results.