setup-unity icon indicating copy to clipboard operation
setup-unity copied to clipboard

Caching installation

Open Josephksa opened this issue 3 years ago • 10 comments

Installing Unity takes up to 8 minutes on each workflow run, do you advise caching it?

Josephksa avatar Nov 22 '21 13:11 Josephksa

I would like to know this as well

javier-cestau avatar Aug 30 '22 13:08 javier-cestau

Same. Its taking too long for this step to complete

bssughosh avatar Oct 02 '22 11:10 bssughosh

Anybody found a workaround for this?? Just until this issue is finished

RubensKj avatar Mar 23 '23 02:03 RubensKj

@RubensKj is actions/cache not suitable?

https://github.com/actions/cache

Considering the Unity installation path is known, surely it could be cached using the above utility.

I guess be careful to also cache Application Support if running on 'Darwin'.

Final thought for Darwin is that you may also need to manually apply execution permissions again once the cache is restored. Example of this can be seen in the 'post install' method.

TheoPM avatar Apr 15 '23 14:04 TheoPM

I tried using this cache action, but I don't know all the paths that we need to cache. I tried the Unity installation folder, but it didn't work.

Did you find a way to cache using this action and also works for you??

RubensKj avatar Apr 15 '23 14:04 RubensKj

Were you able to achieve a 'cache hit' upon reading the cache?

It is important to remember your cache can only be located if it is on the:

  • default branch (usually main)
  • current branch
  • 'base branch' if the action is executed from a pull_request trigger

My test repo 'default branch' is develop, so I ensure the cache is created on develop, and as a result it is available to all branches. This is useful as all branches in my repo can access the Unity Installation I have cached.

TheoPM avatar Apr 15 '23 19:04 TheoPM

Yeap! I cached the entire Unity installation folder (it was about 6gb of cache size), and when I try to used unity command lines (already restore the cache), it gives some random error. Searching for it, it seems to be missing the Microsoft Visual Studio tools, but I don't what i should cache for that.

RubensKj avatar Apr 15 '23 19:04 RubensKj

Can you show a few on how your pipeline works?? I would love to have a look

RubensKj avatar Apr 15 '23 19:04 RubensKj

Away from my Mac at the moment, but worth mentioning mine is a Linux installation.

In the meantime you might consider dumping logs of the windows OS program files directories before/after to see what MS VS dirs may be added.

That diff might help you figure out other root directories to cache/restore?

TheoPM avatar Apr 16 '23 14:04 TheoPM

If anyone has figured this out and sped things up massively do you mind sharing a snippet of your workflow yaml showing how you set it up?

TristanSpeakEasy avatar Aug 25 '23 17:08 TristanSpeakEasy