All jobs in workflow on one particular runner

If I have 2 self-hosted runners matching the tags for all the steps within the workflow, is it possible for jobs to be assigned to different runners (i.e steps 1-2 on one machine, 3-4 on other). Sequence of steps is defined (i.e needs: build, etc.). If so, how can I avoid switching between idle runners between steps?

@rsolovev,

In the workflow, once a runner is assigned to a job, all the steps in this job run only on this runner, and you are not able to assign another runner to some of the steps.

If you wants to assign special self-hosted runners to different jobs in the workflow, you can add different labels for each self-hosted runner to distinguish them. Then you can assign special self-hosted runner to each job according to the different labels.

To view more details, you can see the docs below:
https://help.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow#using-custom-labels-to-route-jobs

1 Like