Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to integrate with caching #283

Closed
niccokunzmann opened this issue Mar 25, 2024 · 7 comments · Fixed by #284
Closed

How to integrate with caching #283

niccokunzmann opened this issue Mar 25, 2024 · 7 comments · Fixed by #284

Comments

@niccokunzmann
Copy link
Contributor

For caching, I see this section:

Integration with actions/cache:

What I do not know is the following:

  • Is that all the code that I need?
  • Do I need to configure caching paths before this?
  • What benefit does it have to cache?
  • Is caching enabled by default or not?
@bartekpacia
Copy link
Collaborator

If you want to take advantage of caching, you just need to set cache: true:

- name: Set up Flutter
  uses: subosito/flutter-action@v2
  with:
    channel: stable
    flutter-version: 3.19.0
    precache: true # <--

@niccokunzmann
Copy link
Contributor Author

Uh, I just created #284 and I wonder what the difference between precache and cache is.

@bartekpacia
Copy link
Collaborator

Ugh, my bad!

@bartekpacia
Copy link
Collaborator

I meant this:

- name: Set up Flutter
  uses: subosito/flutter-action@v2
  with:
    channel: stable
    flutter-version: 3.19.0
    cache: true # <--

@bartekpacia
Copy link
Collaborator

precache is still WIP: #276

@widarlein
Copy link

This might be a stupid question on a closed issue, but what exactly does cache: true do? I don't seem to see any improvements in build time :/

@bartekpacia
Copy link
Collaborator

bartekpacia commented Jun 27, 2024

Not a stupid question at all:). cache:true makes subosito/flutter-action use actions/cache under the hood (source link) to cache (1) Flutter SDK installation and (2) Pub dependencies.

I don't seem to see any improvements in build time :/

I guess this is because archiving cache + sending cache to github and (in a subsequent workflow run) downloading cache from github is not necessarily much faster than just downloading everything from Google servers every time.

If you don't see any improvement, feel free to disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants