setup-dart
setup-dart copied to clipboard
Improve the caching of the downloaded sdks
From the review of https://github.com/dart-lang/setup-dart/pull/1 by @athomas:
Perhaps we should download this into ${RUNNER_TOOL_CACHE}/dart//
That would enable checking if the version is in the cache later. It would mean we'd have to resolve latest to a specific version though.
We could cache the etag, too – then use a HEAD
request to compare?
Starting to get a bit complex for a bash script, though...
Ooo! See https://stackoverflow.com/a/12475760/39827
curl --dump-header header_dump www.google.no
curl -I -v --header 'If-None-Match: "1d30-4c993ec28581d"' http://httpd.apache.org
This could mitigate some of the flakiness we are seeing downloading the SDK.
Someone wants to take a stab at that in a PR? Then we can commit that, and try out the action pinned to that commit in some repo and see if that helps with flakiness?
This has already been done. The current script uses RUNNER_TOOL_CACHE
From some investigation, I don't believe this action is using caching. We are writing the downloaded and uncompressed sdk into $RUNNER_TOOL_CACHE
, but I don't believe that directory implies any automatic caching. I believe it's just the path to a directory with many pre-installed sdks for various languages (pre-installed for the specific image).