-
-
Notifications
You must be signed in to change notification settings - Fork 11
Use GitHub Actions cache for installed binaries #5
base: master
Are you sure you want to change the base?
Changes from 2 commits
40cec18
981bb2e
0d51c02
9f5d8b9
57e52b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,19 +9,22 @@ export interface Input { | |
| crate: string; | ||
| version: string; | ||
| useToolCache: boolean; | ||
| useCache: boolean; | ||
| primaryKey?: string; | ||
| restoreKeys?: string[]; | ||
| } | ||
|
|
||
| export function get(): Input { | ||
| const crate = input.getInput("crate", { required: true }); | ||
| const version = input.getInput("version", { required: true }); | ||
| const useToolCache = input.getInputBool("use-tool-cache") || false; | ||
| const useCache = input.getInputBool("use-cache") || true; | ||
| const primaryKey = input.getInput("key") || undefined; | ||
| const restoreKeys = input.getInputAsArray("restore-keys") || undefined; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it is a good idea to force users to provide all necessary cache keys, as Action can do that by itself; grab the crate name, version and current runner name (ex. Ideally, from the user side I would expect to write - uses: actions-rs/install@v0.2
with:
crate: cargo-makeand it will handle all the stuff by itself.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My thought behind adding those keys was that there is currently no way to force-update a cache. If a new cache should be created, the cache has to get a new name. With But when caching binaries I guess only naming the hash with the version number should do the trick. There should be no need to add a hash to the cache name. Should I remove the keys completely or should I just make them optional? The part with resolving the version is already implemented. But I still have to add the runner name.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @svartalf Do you have a suggestion how I might get the name of the runner? I looked at the If we're able to get the runner name $somehow, we can get rid of the |
||
|
|
||
| return { | ||
| crate: crate, | ||
| version: version, | ||
| useToolCache: useToolCache, | ||
| useCache: useCache, | ||
| primaryKey: primaryKey, | ||
| restoreKeys: restoreKeys, | ||
| }; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.