Repository navigation
[ci] Cache the Android CLI for AndroidDependenciesTests - #13717
Closed
simonrozsival wants to merge 1 commit into
Closed
simonrozsival wants to merge 1 commit into
simonrozsival wants to merge 1 commit into
Conversation
`InstallAndroidDependencies` downloads Google's Android CLI into a per-user cache directory and reuses it when its SHA-256 matches. Restore that directory with `Cache@2` before `AndroidDependenciesTests` so CI does not download the ~90 MB CLI on every run. The cache key includes `Xamarin.Installer.Common.targets`, which defines the CLI version and hashes. SDK packages and the JDK are still downloaded live. Co-authored-by: Copilot App <[email protected]>
7 tasks
Member
Author
|
Closing this cache experiment for now. The measurements so far don't establish a reliable CI improvement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: #13644, #13701
InstallAndroidDependenciesTestdownloads the ~90 MB Android CLI from dl.google.com on every run, and each download is another chance to fail on the network.InstallAndroidDependencies.GetAndroidCliAsyncalready reuses$(_AndroidCliDirectory)when the SHA-256 matches and downloads again otherwise, so caching that directory doesn't change what the test checks.This adds
cache-android-cli.yaml. It pointsANDROID_CLI_CACHE_DIRat the per-user CLI directory and restores it withCache@2. The key isXamarin.Installer.Common.targets, which pins the CLI version and hashes. The template runs before the Linux AndroidDependenciesTests step in the public and internal pipelines and instage-linux-tests.yaml.What isn't cached, and why:
.sdk/archarchives after extracting them, and the test wipes its SDK directory before each attempt.Path.GetTempFileName(). Caching would need a product change and would remove live JDK-download coverage, and that download is where the original flakiness was.Expected saving is seconds, not minutes; the main gain is less network flakiness. In main build 1693891 the whole AndroidDependenciesTests step took 184s.
Testing: the YAML parses. CI is pending. Check the second run on this PR for a cache hit and for the test reusing the CLI instead of downloading it.