-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: custom key for cache #182
Conversation
"description": "setup-android for self hosted runner", | ||
"main": "dist/setup/index.js", | ||
"scripts": { | ||
"postinstall": "patch-package", | ||
"build": "tsc", | ||
"format": "prettier --write '**/*.ts'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding quotes, cannot be executed on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍 👍 👍 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is formatted by prettier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks reformat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!!!!!!!
Perfect code!
@@ -116,3 +116,35 @@ jobs: | |||
|
|||
- run: | | |||
sdkmanager --install "system-images;android-31;default;x86_64" | |||
|
|||
test_custom_cache_key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks reformat!
|
||
# default: `${sdkVersion}-${buildToolsVersion}-${ndkVersion}-${cmakeVersion}-v3.1` | ||
# Custom key for cache. It is invalid when `cache-disabled: true` | ||
cache-key: 'custom-cache-key' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
cache-key: | ||
required: false | ||
description: 'cache key' | ||
default: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
"description": "setup-android for self hosted runner", | ||
"main": "dist/setup/index.js", | ||
"scripts": { | ||
"postinstall": "patch-package", | ||
"build": "tsc", | ||
"format": "prettier --write '**/*.ts'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍 👍 👍 👍
@@ -1,13 +1,13 @@ | |||
{ | |||
"name": "setup-android", | |||
"version": "2", | |||
"version": "3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍 👍 👍 👍 👍 👍
I will release soon and include v3. |
@wtto00 |
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.