GH-900 ยท Automation and AI-assisted development
Workflows, events, jobs and runners
Workflow YAML files in .github/workflows, triggering events, jobs, steps, actions from the Marketplace, and GitHub-hosted versus self-hosted runners.
Key points
- A workflow is a YAML file in .github/workflows.
- An event (a push, a pull request, a schedule, a manual start) triggers it.
- It contains jobs; each job runs on one runner (GitHub-hosted or self-hosted) and is made of steps that run in order.
- A step runs a shell command or a reusable action, for example one from the Marketplace.
- Jobs run in parallel unless one is made to depend on another.
Source: https://docs.github.com/en/actions/get-started/understand-github-actions
Practice questions
In which folder do workflow files live in a repository?
- .github/workflows
- .actions/ci
- workflows/.github
- .devcontainer/workflows
Show answer
Answer: A. .github/workflows
GitHub only discovers workflows in .github/workflows. The other paths are not scanned for workflows.
Which statements about GitHub-hosted runners are true?
- They are available with Ubuntu Linux, Windows and macOS
- Each run executes in a freshly provisioned virtual machine
- They need no hardware of your own to be maintained
- They keep files from the previous run for the next one
- They must be installed in your own data center
Show answer
Answer: A. They are available with Ubuntu Linux, Windows and macOS, B. Each run executes in a freshly provisioned virtual machine, C. They need no hardware of your own to be maintained
They offer Ubuntu, Windows and macOS and give each run a fresh VM. They are not permanent machines in your data center; that describes self-hosted runners.
True or false: the steps inside a single job run in parallel by default.
Show answer
Answer: False
False. Steps run sequentially in order; it is jobs that run in parallel by default.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
