egor-tensin / setup-mingw

GitHub action to set up MinGW-w64
MIT License
74 stars 25 forks source link

Can this action be cached / sped up? #2

Open stefanhendriks opened 2 years ago

stefanhendriks commented 2 years ago

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 commented 2 years ago

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 :)

egor-tensin commented 2 years ago

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.

stefanhendriks commented 2 years ago

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 commented 2 years ago

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.

coffeebe4code commented 1 year ago

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

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