subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.23k stars 199 forks source link

2.x slow on private runners #122

Closed kuhnroyal closed 2 years ago

kuhnroyal commented 2 years ago

After the update to 2.0.4 and adding the caching step, the whole Flutter setup still takes around 3min (mostly downloading and unpacking 3GB cache) compared to 0ms before.

The caching is really nice but on private runners the installation was previously stored in a version-specific folder which was just reused on the next run, making it much faster.

It would be great if we can add a switch to keep the old behavior and prevent re-downloads if the folder exists.

subosito commented 2 years ago

Hi @kuhnroyal, could you list the directory structure on private runners? I am not familiar with those. We might be able to allow customization for the tool cache directory path.

kuhnroyal commented 2 years ago

The ${{ runner.tool_cache }} works on private runners. With 1.x we had folders like ${{ runner.tool_cache }}/flutter/2.5.3, if I remember correctly. This would allow private runners to just reuse that folder because it does not get cleaned up like on public runners.

We could add a install-path parameter that defaults to ${{ runner.tool_cache }}/flutter. Just need to somehow skip the cache action if the folder exists.

subosito commented 2 years ago

@kuhnroyal, I have just added the cache-path option in https://github.com/subosito/flutter-action/commit/4f5d1c6d12e14c538d07e4016061fc111101e46f, feel free to try it using subosito/flutter-action@main.

Please let me know the result on your side, if everything is ok, I will push a new release for that.

kuhnroyal commented 2 years ago

Looks good! Bildschirmfoto 2022-01-13 um 18 13 46

subosito commented 2 years ago

Thanks, @kuhnroyal, just released v2.2.0 and updated v2 for this. You can now use subosito/flutter-action@v2.