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

Can this action be cached / sped up?

Open stefanhendriks opened this issue 3 years ago • 7 comments

I am not as proficient with Github Actions, so forgive me for asking if this is a trivial thing.

For my project, I use this awesome action and it works as expected (Installs MinGW32 bit version). However, it takes 8-9 minutes to install MinGW. I was wondering if this step could be cached, as this step is everytime the same?

See also: https://github.com/stefanhendriks/Dune-II---The-Maker/runs/4582880457?check_suite_focus=true

And the yml file: https://github.com/stefanhendriks/Dune-II---The-Maker/blob/master/.github/workflows/build_cmake.yml

stefanhendriks avatar Dec 20 '21 14:12 stefanhendriks

I added a cache step in this PR; https://github.com/stefanhendriks/Dune-II---The-Maker/runs/4608468014?check_suite_focus=true

however, it only shaves off 1 minute orso. Looks like the uninstall mingw step takes a long time. Not sure why/how this can be sped up. If you have any suggestions, please let me know :)

stefanhendriks avatar Dec 22 '21 15:12 stefanhendriks

Hello. First of all, thanks for brining this up. Sorry for the delay, I'm just completely swamped with work. I'll take a look now.

egor-tensin avatar Dec 22 '21 16:12 egor-tensin

Awesome, thanks!.

FYI: Just saw another PR taking 14 minutes with MinGW.

Maybe it has something todo with me needing a 32bit version? Anyway, any suggestion is welcome.

stefanhendriks avatar Dec 22 '21 21:12 stefanhendriks

With the GH cache PR , I have a consistent ~ 8 minute build (so no builds taking longer). So I guess it is all now relying on the whole uninstalling thing I think.

stefanhendriks avatar Dec 22 '21 21:12 stefanhendriks

I found this in the github actions documentation. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action

coffeebe4code avatar Jul 29 '22 01:07 coffeebe4code

I was able to get caching working as expected, I forked this action, and allowed for custom versions of mingwtoolchain to be used. Here is a skipped cache run. https://github.com/coffeebe4code/cons/runs/7588745986?check_suite_focus=true

Here is the usage. https://github.com/coffeebe4code/cons/blob/main/.github/workflows/ci.yml

coffeebe4code avatar Jul 30 '22 03:07 coffeebe4code