Bitzu

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

Single choice

In which folder do workflow files live in a repository?

  1. .github/workflows
  2. .actions/ci
  3. workflows/.github
  4. .devcontainer/workflows
Show answer

Answer: A. .github/workflows

GitHub only discovers workflows in .github/workflows. The other paths are not scanned for workflows.

Select all that apply

Which statements about GitHub-hosted runners are true?

  1. They are available with Ubuntu Linux, Windows and macOS
  2. Each run executes in a freshly provisioned virtual machine
  3. They need no hardware of your own to be maintained
  4. They keep files from the previous run for the next one
  5. 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

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.

Download on the App StoreGet it on Google Play

More GH-900 topics in this module