GitHub Foundations — Question 4

As a developer, you need to leverage Redis in your workflow. What is the best way to use Redis on a self-hosted Linux runner without affecting future workflow runs?

Answer options

Correct answer: C

Explanation

The correct answer is C because using the container: and services: options allows you to run Redis in an isolated environment specific to that job, ensuring it does not affect other runs. Option A is incorrect as installing Redis on the runner image could lead to conflicts in future runs. Option B is less efficient because it involves managing a separate machine, and option D introduces unnecessary complexity by dynamically installing Redis during the job.