Buildkite Certification

Learn · Step types and pipeline structure

File order is not run order

Here is a pipeline that does not do what it looks like it does.

steps:
  - command: make build
  - command: make test
  - command: make deploy

Read top to bottom, that looks like build, then test, then deploy. It is not. All three steps start at the same time, on three different agents, as soon as the build begins. make deploy may well finish before make build has started.

Buildkite runs every step in parallel unless you tell it otherwise. Writing steps in an order does not create a dependency between them — it only decides what order they appear in the UI.

There are two ways to impose order.

A wait barrier stops everything until everything before it is done:

steps:
  - command: make build
  - wait
  - command: make test

Explicit dependencies say precisely what depends on what, which lets unrelated work keep running in parallel. That is the next module.

Reach for wait when the pipeline really does have distinct phases. Reach for dependencies when it does not — a barrier makes your fastest step wait for your slowest one, every time.

Check

Write a pipeline that runs `make build`, then — only once the build has finished — runs `make test`. Use a barrier rather than explicit dependencies.

Sign in to answer and record your progress.