Workflows, jobs & steps
Read YAML as structured data
Lesson 2 of 20 · 12 min · Module 1: Feedback and workflow structure
Indentation decides which runner and steps belong to a job.
Start this lesson →Free. No installation: you write and run the code in your browser, and it is checked automatically.
By the end, you’ll be able to…
- Identify the mapping boundaries
- Use a sequence for ordered steps
The idea
A workflow combines an event boundary, job dependencies, and ordered steps. Conditions and prerequisite outcomes determine which jobs can run.
01Identify the mapping boundaries
jobs maps job IDs to their configuration. runs-on and steps belong inside a job, rather than at the workflow root.
02Use a sequence for ordered steps
The dash introduces each step in a YAML sequence. Steps in one job execute in order on that job runner.
03Let a parser reject ambiguous structure
The lab uses a YAML parser that rejects duplicate mapping keys. A second jobs key should not quietly overwrite the first.
Your turn
What the checks look for
- Defines the expected runner
- Runs the two ordered steps
Take this with you
Read the data structure before reading the command text.
Go a little further
Add a harmless third echo step and inspect its order in the model.