hey24sheep / azure-flutter-tasks

Easily build and deploy with latest Flutter build tasks for Azure DevOps Pipelines Tasks
https://marketplace.visualstudio.com/items?itemName=Hey24sheep.flutter
MIT License
89 stars 22 forks source link

Caching Flutter install for Parallel Builds (install as Artifact) #95

Closed Zazo032 closed 1 year ago

Zazo032 commented 1 year ago

We would like to run multiple jobs in parallel, so we have a common job that runs FlutterInstall, and other jobs that depend on the common one. The other jobs can't find flutter in the path. How could we cache the flutter installation to read it (not download) in the parallel jobs? If we have 6 parallel jobs, we would like to avoid running FlutterInstall 6 times to save some time.

hey24sheep commented 1 year ago

Hi, Caching already implemented in this extension check this line.

Caching is done for subsequent builds. Parallel builds are a different thing. If your parallel builds will include this "Install task", they will automatically become cached the 2nd time they run.

But, what I am getting is you want a single time run and cache for all. That is not caching but artifact. The way it will work is, you will need to upload the Flutter SDK as an artifact and then get that artifact during pipeline build and create the variables for build, etc.

Install doesn't have anything of the sort as I am not aware of how Artifacts work as I have not used them personally.

Zazo032 commented 1 year ago

@hey24sheep I'm not sure if I understood the current caching strategy - running the install task always downloads Flutter in our case, in each created PR, even for subsequent builds or subsequent jobs