0

We are using GitHub Action Self Hosted Runners on a Windows Server to build and deploy private repositories. For context, they are .NET Projects.

A pattern we've adopted is to break out a workflow into multiple jobs (checkout, restore, build, test & deploy). Some of these jobs can be run in parallel, some need other jobs to complete before they can start.

I have tried to set up two Runners in the same Runner Group on the same machine. My Expectations:

  1. Be able to run multiple workflows at the same time (one runner per workflow)
  2. Be able to run multiple jobs in a single workflow at the same time (multiple runners per workflow)

Self Hosted Runners have their own folder: _work which is where $Env:GITHUB_WORKSPACE points.
When I tried #2 above, I saw both runners working on the same workflow, but they were using their own respective _work folders. The first runner would check out a repo to its _work folder and the second runner would error out because it couldn't find the repo in its _work folder.

Possible Solutions:
A) Move the _work directory to a root folder that both runners can access
B) Remap $Env:GITHUB_WORKSPACE for each workflow

I don't believe either of these solutions works, what am I missing? Is there a better technique here for using multiple self hosted runners?
I would even be happy if I could have my #1 expectation of one runner per workflow.

riQQ
  • 9,878
  • 7
  • 49
  • 66
Airn5475
  • 2,452
  • 29
  • 51
  • Both points do work. If you would share your workflow maybe we could see why it doesn't work for you. – frennky Jan 21 '22 at 12:34
  • @frennky you're saying for #2 that two runners operating on different jobs inside the same workflow at the same time will use the same directory? I haven't found that to be the case. – Airn5475 Jan 24 '22 at 13:22
  • No, I'm just saying both points do work. There is no mention of directories in those two points. If you'd like to follow the community guidelines, restructure your question, make it reproducible etc., that would increase the chances of getting an acceptable answer. – frennky Jan 24 '22 at 13:35
  • Hi @Airn5475 I am also stuck in this. DIdi you get answer of this question? Here is my question https://stackoverflow.com/questions/71477604/run-lint-and-lint-tests-in-parallel-in-github-actions-with-self-hosted-runner – Ashish Kumar Mar 15 '22 at 06:38
  • @AshishKumar I did not yet, but I believe this Issue on the Checkout Action could be a solution. I am actively monitoring it and waiting for it to be released! https://github.com/actions/checkout/pull/388#issuecomment-1065154189 – Airn5475 Mar 16 '22 at 20:05

0 Answers0