Github Actions Strategy Matrix reusing runner

I have setup a strategy matrix in one of my workflows…
The type of workflow I have does not require a separate runner to be provisioned/setup.

Since each job generated from the matrix contains one step that takes less than a second, I am seeing a significant chunk of time spent on setting up a runner for each job.

I want to be able to tell GitHub to use a single runner for all of the matrix jobs so setup step occurs once only, but to still run all the jobs in parallel.

I noticed huge time savings if I just use GNU Parallel but I would lose access to the outputs of each job without doing significant inspection.

1 Like

:wave: Hey @kaovil,

This isn’t something we support currently. What does your workflow look like where each job is one second?

I would lose access to the outputs of each job without doing significant inspection.

Are you able to set a different name for each job output so that they could all come from the same job?
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs

I’m not sure what you mean by significant inspection, but one of the workflow expressions might help

https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions

@joshmgross

I also need this feature. Here is my use case:

I use matrix strategy to build apps in the monorepo. All them are built from one Dockerfile.
So the goal is to share Docker cache among jobs.
The natural thing would be to use “actions/cache” , but it’s not working on Github Enterprise (GHES support · Issue #505 · actions/cache · GitHub). So that we would like to run all jobs on one runner (which is not cleared after each job), so Docker cache is reused.