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:
- Be able to run multiple workflows at the same time (one runner per workflow)
- 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.