GitHub Actions Basics: Workflows, Jobs u0026 Runners Quiz Quiz

Explore the foundational concepts of workflows, jobs, and runners with this interactive quiz on automation pipelines. Assess your understanding of configuring workflows, orchestrating jobs, and selecting appropriate runners for successful continuous integration and deployment.

  1. Workflow Trigger Basics

    Which statement best describes how a workflow is triggered in an automation pipeline, for example when code is pushed to a repository?

    1. A workflow runs automatically based on specific events such as a code push or pull request.
    2. A workflow must be started every time by an external webhook service.
    3. A workflow can only be scheduled to run once a month automatically.
    4. A workflow only runs if executed manually from a command line interface.

    Explanation: Workflows are typically triggered automatically when a specified event occurs, such as when code is pushed or a pull request is created. Option B is incorrect because manual triggers are optional, not the default. Option C is inaccurate, as workflows can be scheduled far more frequently than once a month. Option D misstates the process; external webhooks are one trigger type but not the only or most common one.

  2. Job Dependencies

    In a workflow file, how can you ensure that one job starts only after another has successfully completed?

    1. By renaming the jobs to match each other.
    2. By arranging the order of jobs alphabetically in the workflow file.
    3. By using the 'needs' keyword to define dependencies between jobs.
    4. By setting a 'delay' property in the dependent job.

    Explanation: The 'needs' keyword is used to specify that one job depends on another, ensuring correct execution order. Listing jobs alphabetically (option B) does not establish dependencies. Option C, 'delay' property, does not control job sequencing. Option D, renaming jobs, has no impact on workflow execution order.

  3. Runners and Their Purpose

    Which of the following best explains the purpose of a runner in a workflow execution scenario?

    1. A runner assigns reviews to collaborators after jobs are completed.
    2. A runner provides the environment to execute each job's steps in a workflow.
    3. A runner stores all version control history for a project.
    4. A runner is used only for sending notifications after a workflow finishes.

    Explanation: A runner is the computing environment that processes the steps defined in each job of a workflow. Option B is incorrect because version control data is managed separately. Option C is not correct; sending notifications can be a job, but it isn't the runner's main role. Option D relates to code review assignments, which are not the runner's function.

  4. Workflow YAML Placement

    Where should an automation workflow configuration file be placed to be automatically detected by the system?

    1. Nested deep inside any random subfolder for privacy.
    2. At the root level of the repository with a .txt extension.
    3. In the .github/workflows directory of the project repository.
    4. Inside a separate 'automation' folder outside the project directory.

    Explanation: The system automatically detects and runs workflow files located in the .github/workflows directory. Using a .txt extension at the repository root (option B) is not recognized by the workflow engine. Option C is incorrect because files outside the designated directory are ignored. Option D is also wrong, as workflows in random or deeply nested folders are not detected.

  5. Multiple Jobs Parallelism

    What happens when a workflow defines multiple jobs without any dependencies between them?

    1. Jobs execute in alphabetical order based on their names.
    2. All jobs run in parallel by default unless told otherwise.
    3. The workflow fails because jobs must have dependencies.
    4. All jobs are merged into a single sequential process.

    Explanation: If no dependencies are specified, jobs in a workflow are processed in parallel to improve efficiency. Option B is incorrect; jobs are not merged into a single process by default. Option C is not how execution order is determined unless dependencies exist. Option D is incorrect since workflows do not require explicit dependencies for jobs to execute properly.