kuler90 / setup-unity

GitHub Action to download and install Unity on Ubuntu, macOS or Windows. Based on Unity Hub
MIT License
37 stars 33 forks source link

Caching installation #4

Open Josephksa opened 2 years ago

Josephksa commented 2 years ago

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

javier-cestau commented 2 years ago

I would like to know this as well

bssughosh commented 1 year ago

Same. Its taking too long for this step to complete

RubensKj commented 1 year ago

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

TheoPM commented 1 year ago

@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.

RubensKj commented 1 year ago

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??

TheoPM commented 1 year ago

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:

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.

RubensKj commented 1 year ago

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 commented 1 year ago

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

TheoPM commented 1 year ago

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?

TristanSpeakEasy commented 1 year ago

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?