Repository navigation
feat: custom key for cache - #182
Merged
Merged
Conversation
wtto00
commented
Oct 2, 2023
| "scripts": { | ||
| "postinstall": "patch-package", | ||
| "build": "tsc", | ||
| "format": "prettier --write '**/*.ts'", |
Contributor
Author
There was a problem hiding this comment.
Adding quotes, cannot be executed on Windows.
wtto00
commented
Oct 2, 2023
Contributor
Author
There was a problem hiding this comment.
This is formatted by prettier
amyu
reviewed
Oct 2, 2023
| - run: | | ||
| sdkmanager --install "system-images;android-31;default;x86_64" | ||
|
|
||
| test_custom_cache_key: |
|
|
||
| # default: `${sdkVersion}-${buildToolsVersion}-${ndkVersion}-${cmakeVersion}-v3.1` | ||
| # Custom key for cache. It is invalid when `cache-disabled: true` | ||
| cache-key: 'custom-cache-key' |
| cache-key: | ||
| required: false | ||
| description: 'cache key' | ||
| default: '' |
| "scripts": { | ||
| "postinstall": "patch-package", | ||
| "build": "tsc", | ||
| "format": "prettier --write '**/*.ts'", |
| { | ||
| "name": "setup-android", | ||
| "version": "2", | ||
| "version": "3", |
Owner
|
I will release soon and include v3. |
Owner
|
@wtto00 |
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.
When the user does not disable the use of cache (cache-disabled:true), the user can customize the cache key.
For example: https://github.com/wtto00/karma-android-launcher/actions/runs/6380253195/workflow
Here I am running 14 tasks simultaneously, and each task will execute the following shell commands:
However, all the cache keys for these tasks are the same, so the cache for the 'system-images' I installed is not saved, or only one of them is cached. They will overwrite each other.
In addition, each task will create an emulator, which is a time-consuming task to create and launch the emulator from scratch. If it can be cached, it will be much faster.
If it is possible to customize the cache key, all the data for different tasks can be cached, and the next execution will be much faster. It won't need to download and create the emulator from scratch every time.