Q23 of 38 · CI/CD & DevOps

What is the difference between a pipeline stage, a job, and a step in CI?

CI/CD & DevOpsJuniorci-cdpipelinegithub-actionsjobsstagessteps

Short answer

Short answer: A stage is a logical phase of the pipeline (build, test, deploy). A job is a unit of work that runs on an agent within a stage. A step is a single command or action inside a job.

Detail

In GitHub Actions a workflow contains jobs, each job has steps. In GitLab CI and Jenkins, pipelines contain stages, stages contain jobs, and jobs contain script commands.

The hierarchy determines ordering and parallelism. Stages run sequentially by default (build → test → deploy). Jobs within the same stage can run in parallel, halving that stage's wall-clock time. Steps inside a job run sequentially.

For QA: unit tests, lint, and security scans can be separate jobs inside a "Test" stage and run in parallel. E2E tests typically live in a downstream "Integration" stage so they only run if the fast checks pass first.

// EXAMPLE

.github/workflows/test.yml

jobs:
  unit-tests:        # runs in parallel with api-tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm test

  api-tests:         # runs in parallel with unit-tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run test:api

// WHAT INTERVIEWERS LOOK FOR

Correct understanding of the three levels. Knowing jobs in the same stage can run in parallel. Ability to connect this to real CI tools they've used.