actions / checkout

Action for checking out a repo
https://github.com/features/actions
MIT License
5.99k stars 1.77k forks source link

How to optimise checkout of a monorepo? #1558

Open igwejk opened 1 year ago

igwejk commented 1 year ago

For a monorepo of size significantly greater than 1GB, cloning or fetching the repository can be time intensive and degrade the performance of a job.

In a self-hosted runner, one way to remedy the situation is to have a pre-provisioned repository in the runner. That way, improvement can be gained...

Using git clone ...

The are two methods for optimising git clone ...

Question❓

It is currently difficult or impossible to leverage the above measures with actions/checkout. For the following reasons

  1. Rather than git clone ..., git init is used. Hence, the --reference[-if-able] <repository> option is not supported by actions/checkout. Is there any reason why the git init flow was preferred above git clone ...❓ Or can we switch to git clone ... and then support the --reference[-if-able] <repository> option?
  2. Would it help if I pointed actions/checkout to an existing git repository?
igwejk commented 1 year ago

On the second question. I suppose it won't help to point to a directory with an existing repository due to the following aspect of the current implementation.

Image

Dmitry1987 commented 11 months ago

same for my 7gb repo 😢 the only option is to simply use a CLI command steps instead of checkout action, I wonder if there will be support for using existing pre-cached repo in the runner, instead of a fresh new init and clone? 🙏