-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add lookup-only
option
#1041
Add lookup-only
option
#1041
Conversation
src/restoreImpl.ts
Outdated
@@ -34,12 +34,13 @@ async function restoreImpl( | |||
const enableCrossOsArchive = utils.getInputAsBool( | |||
Inputs.EnableCrossOsArchive | |||
); | |||
const dryRun = utils.getInputAsBool(Inputs.DryRun); |
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.
Did you try running a sample workflow of this version of action with cache
action?
As cache
action doesn't have this input and only restore
action has, I'm curious if it throws any warning with this implementation?
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.
Not sure I understand your question correctly.
The dry-run
input is defined for both the normal cache
and also the cache/restore
action with default: 'false'
.
I'm curious if it throws any warning with this implementation?
Even if it wouldn't be defined, the code shouldn't throw an error. utils.getInputAsBool
uses core.getInput
under the hood which returns an empty string for undefined variables. The result would thus still be false
.
cache/src/utils/actionUtils.ts
Lines 55 to 60 in 22cbf49
export function getInputAsBool( | |
name: string, | |
options?: core.InputOptions | |
): boolean { | |
const result = core.getInput(name, options); | |
return result.toLowerCase() === "true"; |
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.
Pushed a small update for the readmes to reflect the changes in action.yml
.
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.
Got it, I was under assumption that this input is only for the restore
action.
Which brings me to my next question, how is the behaviour in case of the cache
action?
Usually the cache
action saves cache in the post step when cache-hit
output is set to false
. Wouldn't unnecessary caches be saved when dry-run
:true
and no cache is found?
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.
Which brings me to my next question, how is the behaviour in case of the
cache
action?
Usually thecache
action saves cache in the post step whencache-hit
output is set tofalse
. Wouldn't unnecessary caches be saved whendry-run
:true
and no cache is found?
I don't think so. The main use case I have in mind for it would depend on saving the cache afterwards. dry-run: 'true'
is meant to speed up the case where the cache would be created from scratch anyway. If no exact cache is found, it still needs to be created and stored after that to be able to use it for the next run.
This works best, if restore-keys
is left empty as downloading those would be skipped as well. However, it can still be archived by stacking the cache/restore
(with dry-run: 'true'
) and normal cache
(with restore-keys
) action. The first would be there to filter out exact matches, while the following steps would only run if cache-hit
is false
.
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.
Can we name it better such that the name suits both
actions/cache
andactions/cache/restore
action?
Sure, dry-run
was just the first name that came to mind but I can see how it can be confusing.
What do you think of skip-download
?
I also though about restore-dry-run
or skip-restore
but those don't capture the essence of this option or can be misleading as well. I'm open to other suggestions though.
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.
skip-download
won't make sense for the restore
action right? skip-download
sounds more like save-only
.
restore-dry-run
is still close. My suggestion would be to use something like check-key
(although not quite sure what the perfect name here could be), @bishal-pdMSFT do suggest us something that you feel would be good here.
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.
skip-download
won't make sense for therestore
action right?
I'd disagree. Skipping the download is what's happing internally, regardless of cache
or restore
action. It's also the term I used naturally to describe the parameter in the readme. That's why I thought it might be a good fit.
My suggestion would be to use something like
check-key
Just thinking about it, I could imagine that users could be confused by that, especially if the default is false
. Is the key not checked unless it's set to true
?
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.
skip-download
won't make sense for therestore
action right?
My reason of saying the same was - downloading is the main job of the restore
action and the restore step in the cache
action. For cache
action, the name skip-download
is still fine, but for restore
action, if restore (download) itself is not happening then I see a chance of confusion for the users thinking what it would even do if not download the cache itself. 😕 Hence I was tilting more towards something that tell check-key(-but-dont-download)
Few more suggestions from my end...
How about going in the direction of peek
like we use in stacks, just see but don't do anything.
Examples:
peek-key
/ peek-cache
or
lookup
/ lookup-only
or
spy
Is the key not checked unless it's set to true?
True, it will create a confusion. 😅
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.
For
cache
action, the nameskip-download
is still fine, but forrestore
action, if restore (download) itself is not happening then I see a chance of confusion for the users thinking what it would even do if not download the cache itself.
Just a thought, would it be enough to expose the option only for cache
? On the one hand it would address the main use case, on the other there is some value in exposing the option for all actions.
Hence I was tilting more towards something that tell
check-key(-but-dont-download)
lookup-only
sounds like it could fit. It would make sense in the docs as well. Something like
* `lookup-only` - Skip downloading cache. Only check if cache entry exists. Default: false
Hi @cdce8p, 👋🏽 We had an internal discussion within our team and we felt like this feature might affect the extensibility of the code and feel that having a new action for the same (something like For now we have added the work needed for this new action in our backlog and we will pick this up in the future. In the meantime, if you would want to contribute for the same, you are welcome to do so. :) Thanks for your contribution, we really appreciate your efforts here. ❤️ We can go ahead with the other PR of yours. I have requested a small test case addition in the same. |
Hi @kotewar, thanks for the update. After the other PR was done, I took some time today to think about this one some more. I can understand your point about maintenance. So I did implement a separate new Furthermore, it's worth to consider the main use case again and what from the user perspective might be a good solution. Use case This would probably look something like this. Note that it's basically necessary to duplicate all inputs from the initial build:
steps:
- uses: actions/checkout@v3
- - users: actions/cache@v3
+ - users: actions/cache/check@v3
id: cache-check
with:
path: path/to/dependencies
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Build
if: steps.cache-check.outputs.cache-hit != 'true'
run: /build.sh
+ - uses: actions/cache/save@v3
+ if: steps.cache-check.outputs.cache-hit != 'true'
+ with:
+ path: path/to/dependencies
+ key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
test:
... How would that be different to the input parameter? As the build:
steps:
- uses: actions/checkout@v3
- users: actions/cache@v3
id: cache-check
with:
+ lookup-only: true
path: path/to/dependencies
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Build
if: steps.cache-check.outputs.cache-hit != 'true'
run: /build.sh
test:
... Conclusion To make it easier to compare both, I've rebased this PR as well. In any case, both approaches depend on some ground work: actions/toolkit#1286 -- |
@cdce8p, Did I understand it correctly? And talking of the extensibility, if we feel this could be breaking in the future, we might have to remove it and do a major release instead with a different set of inputs. |
Yes, exactly.
From what I've seen the use case outline above is the only one I've seen (so far). If someone really wants some other options, I feel doing something like #1095 in the future, in addition to the As for the idea to use an environment variable. I'm not sure this would be a good user experience.
Thanks for keeping me in the loop here and valuing my opinion! Appreciate that ❤️ |
@kotewar Just wanted to check, are there any updates? It would be awesome if we could get this over the finish line soon. Especially as not much work is left. Please let me know if I can help in any way. |
Sorry, I was looking into another issues and forgot about this one. Update - released the toolkit. |
Hi @cdce8p, I was testing the action, and found that the log says cache restored, I think that gives wrong info to the user as in the earlier logs we say skipping download
I was thinking it will better if we print something else or don't print the restored log when its a |
action.yml
Outdated
@@ -22,6 +22,10 @@ inputs: | |||
description: 'Fail the workflow if cache entry is not found' | |||
default: 'false' | |||
required: false | |||
lookup-only: | |||
description: 'Skip downloading cache. Only check if cache entry exists' |
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.
Does it check for exact match only? If so, then restore-keys
will be ignored. May be we should call that out here.
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.
restore-keys
won't be ignored, we can update the description to something like
description: 'Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache'
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.
The output cache-hit
will be false in that case.
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.
What's the purpose of accepting the restore-keys argument if we only set cache-hit
to true when an exact match is found? Or do we return the matched key as well just like the restore action? If I understand correctly there is currently no difference in output between no exact match but a partial match.
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.
If I understand correctly there is currently no difference in output between no exact match but a partial match.
Not quite. cache-hit
will be true
for exact matches. Think of it like this: When adding lookup-only
the action behaves just the same (incl. the outputs) as without the argument. The only difference being that the cache entry isn't actually downloaded and extracted.
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 see. Normally there is a purpose of using the restore-keys
because you are actually restoring something, but cache-hit
will still be false. So from the view of the action there is still a cache miss. With this option there are no side effects when a match has occurred on one of the restore-keys
.
While writing this I'm wondering: did I always misinterpret the note on cache-hit
and does it also return true
when an exact hit has been found on one of the restore-keys
but just not on a partial match on the restore-keys
?
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.
While writing this I'm wondering: did I always misinterpret the note on
cache-hit
and does it also returntrue
when an exact hit has been found on one of therestore-keys
but just not on a partial match on therestore-keys
?
cache-hit
will only be true
for an exact match on the primary key.
Lines 67 to 72 in 940f3d7
const isExactKeyMatch = utils.isExactKeyMatch( | |
core.getInput(Inputs.Key, { required: true }), | |
cacheKey | |
); | |
core.setOutput(Outputs.CacheHit, isExactKeyMatch.toString()); |
That doesn't mean though there aren't no side effects now with lookup-only: true
if the key doesn't match. cache-matched-key
is still set.
Lines 64 to 65 in 940f3d7
// Store the matched cache key in states | |
stateProvider.setState(State.CacheMatchedKey, cacheKey); |
--
In practice, I suspect the option will most likely only be used to check for an exact key (i.e. without restore-keys
) but there might be other use cases I haven't though about yet which could use it. In any way as explained here #1041 (comment) the current implementation is not only simpler then a dedicated check
action #1095 (which would have provided the option to remove the input) but also provides a better UX.
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.
Thank you. If that's always the case, then cache-matched-key
should be mentioned as an output of the main action. Currently the only documented output is cache-hit
. Therefore I assumed there were no side-effects in that case. Or this option should only be available in the restore action where this output is actually documented.
-- In practice, I suspect the option will most likely only be used to check for an exact key (i.e. without
restore-keys
) but there might be other use cases I haven't though about yet which could use it. In any way as explained here #1041 (comment) the current implementation is not only simpler then a dedicatedcheck
action #1095 (which would have provided the option to remove the input) but also provides a better UX.
I currently have a usecase where I cache all images in a matrix, and use them in another different matrix later on. In the setup I assume that if one file is successfully cached, all files (with the same prefix) are successfully cached. If this assumption is incorrect the matrix workflow will still succeed but less efficient (however it is unlikely that it would ever happen). It would be a waste to spin up the entire caching matrix just to check each key for a match. During the matrix workflow, each job uses only one file so there is no need to cache them into one key.
But in this case I can check for a match on one particular key instead and it will still have the same result.
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 agree, cache-matched-key
(and even cache-primary-key
like we have in restore
action) will be helpful in the main action's output. We can plan to add it. In case anyone wants to contribute for the same, please feel free to do so. 😄
__tests__/restore.test.ts
Outdated
@@ -330,3 +356,46 @@ test("restore with fail on cache miss disabled and no cache found", async () => | |||
); | |||
expect(failedMock).toHaveBeenCalledTimes(0); | |||
}); | |||
|
|||
test("restore with lookup-only set", async () => { |
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.
Should this test be moved to restoreImpl.tests.ts
as it is a common functionality?
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.
Happy to do so but I think restore.test.ts
does fit. The way I understand it is that restoreImpl.test.ts
include all tests directly related to the cache restore, e.g. what happens if a key is found / want when it isn't, the path matches / doesn't match. In contrast restore.test.ts
tests additional functionality, like failOnCacheMiss
or now lookupOnly
.
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.
Can we instead a new test in restoreImpl.tests.ts
to test the behaviour when lookupOnly
is set to true
? I think that way both files will cover their respective code.
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.
Hope I understood you correctly. As the test already checked the behavior of lookupOnly: true
, I moved it to restoreImpl.test.ts
. Please let me know if you had something else in mind.
lookupOnly: false
is implicitly tested in every other test case as this is the default behavior.
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.
The only thing I had in mind was to check for the behavior of lookupOnly: true
in the restoreImpl
tests, than the wrapper code. I think what you've done looks fine as restoreImpl.test.ts
was missing a lookupOnly: true
case which it has now. :)
I do believe it's useful to know which cache would have been restored. Updated the log statement. |
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.
LGTM.
Hey @cdce8p 👋🏽 Thanks a lot of your contribution and apologies for the delay in reviewing. I've released the new version v3.3.0 to marketplace and also tagged Thanks again for your great work, we appreciate it. 😊 ❤️ |
Thanks @kotewar ❤️ |
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/cache](https://togithub.com/actions/cache) | action | minor | `v3.2.4` -> `v3.3.0` | | [github/codeql-action](https://togithub.com/github/codeql-action) | action | patch | `v2.2.3` -> `v2.2.5` | | [trunk-io/trunk-action](https://togithub.com/trunk-io/trunk-action) | action | patch | `v1.0.6` -> `v1.0.7` | --- ### Release Notes <details> <summary>actions/cache</summary> ### [`v3.3.0`](https://togithub.com/actions/cache/releases/tag/v3.3.0) [Compare Source](https://togithub.com/actions/cache/compare/v3.2.6...v3.3.0) #### What's Changed - Bug: Permission is missing in cache delete example by [@​kotokaze](https://togithub.com/kotokaze) in [https://github.com/actions/cache/pull/1123](https://togithub.com/actions/cache/pull/1123) - Add `lookup-only` option by [@​cdce8p](https://togithub.com/cdce8p) in [https://github.com/actions/cache/pull/1041](https://togithub.com/actions/cache/pull/1041) #### New Contributors - [@​kotokaze](https://togithub.com/kotokaze) made their first contribution in [https://github.com/actions/cache/pull/1123](https://togithub.com/actions/cache/pull/1123) **Full Changelog**: actions/cache@v3...v3.3.0 ### [`v3.2.6`](https://togithub.com/actions/cache/releases/tag/v3.2.6) [Compare Source](https://togithub.com/actions/cache/compare/v3.2.5...v3.2.6) ##### What's Changed - Updated branch in Force deletion of caches by [@​t-dedah](https://togithub.com/t-dedah) in [https://github.com/actions/cache/pull/1108](https://togithub.com/actions/cache/pull/1108) - Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners by [@​pdotl](https://togithub.com/pdotl) in [https://github.com/actions/cache/pull/1118](https://togithub.com/actions/cache/pull/1118) **Full Changelog**: actions/cache@v3...v3.2.6 ### [`v3.2.5`](https://togithub.com/actions/cache/releases/tag/v3.2.5) [Compare Source](https://togithub.com/actions/cache/compare/v3.2.4...v3.2.5) ##### What's Changed - Rewrite readmes by [@​jsoref](https://togithub.com/jsoref) in [https://github.com/actions/cache/pull/1085](https://togithub.com/actions/cache/pull/1085) - Fixed typos and formatting in docs by [@​kotewar](https://togithub.com/kotewar) in [https://github.com/actions/cache/pull/1076](https://togithub.com/actions/cache/pull/1076) - Fixing paths for OSes by [@​kotewar](https://togithub.com/kotewar) in [https://github.com/actions/cache/pull/1101](https://togithub.com/actions/cache/pull/1101) - Release patch version update by [@​Phantsure](https://togithub.com/Phantsure) in [https://github.com/actions/cache/pull/1105](https://togithub.com/actions/cache/pull/1105) ##### New Contributors - [@​jsoref](https://togithub.com/jsoref) made their first contribution in [https://github.com/actions/cache/pull/1085](https://togithub.com/actions/cache/pull/1085) **Full Changelog**: actions/cache@v3...v3.2.5 </details> <details> <summary>github/codeql-action</summary> ### [`v2.2.5`](https://togithub.com/github/codeql-action/compare/v2.2.4...v2.2.5) [Compare Source](https://togithub.com/github/codeql-action/compare/v2.2.4...v2.2.5) ### [`v2.2.4`](https://togithub.com/github/codeql-action/compare/v2.2.3...v2.2.4) [Compare Source](https://togithub.com/github/codeql-action/compare/v2.2.3...v2.2.4) </details> <details> <summary>trunk-io/trunk-action</summary> ### [`v1.0.7`](https://togithub.com/trunk-io/trunk-action/releases/tag/v1.0.7) [Compare Source](https://togithub.com/trunk-io/trunk-action/compare/v1.0.6...v1.0.7) Introduce a caching-only mode, controlled via `check-mode: populate_cache_only`. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/trunk-io/plugins). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTkuMiIsInVwZGF0ZWRJblZlciI6IjM0LjE1OS4yIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/cache](https://togithub.com/actions/cache) | action | minor | `v3.2.5` -> `v3.3.2` | --- ### Release Notes <details> <summary>actions/cache (actions/cache)</summary> ### [`v3.3.2`](https://togithub.com/actions/cache/releases/tag/v3.3.2) [Compare Source](https://togithub.com/actions/cache/compare/v3.3.1...v3.3.2) ##### What's Changed - Fixed readme with new segment timeout values by [@​kotewar](https://togithub.com/kotewar) in [https://github.com/actions/cache/pull/1133](https://togithub.com/actions/cache/pull/1133) - Readme fixes by [@​kotewar](https://togithub.com/kotewar) in [https://github.com/actions/cache/pull/1134](https://togithub.com/actions/cache/pull/1134) - Updated description of the lookup-only input for main action by [@​kotewar](https://togithub.com/kotewar) in [https://github.com/actions/cache/pull/1130](https://togithub.com/actions/cache/pull/1130) - Change two new actions mention as quoted text by [@​bishal-pdMSFT](https://togithub.com/bishal-pdMSFT) in [https://github.com/actions/cache/pull/1131](https://togithub.com/actions/cache/pull/1131) - Update Cross-OS Caching tips by [@​pdotl](https://togithub.com/pdotl) in [https://github.com/actions/cache/pull/1122](https://togithub.com/actions/cache/pull/1122) - Bazel example (Take [#​2](https://togithub.com/actions/cache/issues/2)️⃣) by [@​vorburger](https://togithub.com/vorburger) in [https://github.com/actions/cache/pull/1132](https://togithub.com/actions/cache/pull/1132) - Remove actions to add new PRs and issues to a project board by [@​jorendorff](https://togithub.com/jorendorff) in [https://github.com/actions/cache/pull/1187](https://togithub.com/actions/cache/pull/1187) - Consume latest toolkit and fix dangling promise bug by [@​chkimes](https://togithub.com/chkimes) in [https://github.com/actions/cache/pull/1217](https://togithub.com/actions/cache/pull/1217) - Bump action version to 3.3.2 by [@​bethanyj28](https://togithub.com/bethanyj28) in [https://github.com/actions/cache/pull/1236](https://togithub.com/actions/cache/pull/1236) ##### New Contributors - [@​vorburger](https://togithub.com/vorburger) made their first contribution in [https://github.com/actions/cache/pull/1132](https://togithub.com/actions/cache/pull/1132) - [@​jorendorff](https://togithub.com/jorendorff) made their first contribution in [https://github.com/actions/cache/pull/1187](https://togithub.com/actions/cache/pull/1187) - [@​chkimes](https://togithub.com/chkimes) made their first contribution in [https://github.com/actions/cache/pull/1217](https://togithub.com/actions/cache/pull/1217) - [@​bethanyj28](https://togithub.com/bethanyj28) made their first contribution in [https://github.com/actions/cache/pull/1236](https://togithub.com/actions/cache/pull/1236) **Full Changelog**: actions/cache@v3...v3.3.2 ### [`v3.3.1`](https://togithub.com/actions/cache/releases/tag/v3.3.1) [Compare Source](https://togithub.com/actions/cache/compare/v3.3.0...v3.3.1) ##### What's Changed - Reduced download segment size to 128 MB and timeout to 10 minutes by [@​kotewar](https://togithub.com/kotewar) in [https://github.com/actions/cache/pull/1129](https://togithub.com/actions/cache/pull/1129) **Full Changelog**: actions/cache@v3...v3.3.1 ### [`v3.3.0`](https://togithub.com/actions/cache/releases/tag/v3.3.0) [Compare Source](https://togithub.com/actions/cache/compare/v3.2.6...v3.3.0) ##### What's Changed - Bug: Permission is missing in cache delete example by [@​kotokaze](https://togithub.com/kotokaze) in [https://github.com/actions/cache/pull/1123](https://togithub.com/actions/cache/pull/1123) - Add `lookup-only` option by [@​cdce8p](https://togithub.com/cdce8p) in [https://github.com/actions/cache/pull/1041](https://togithub.com/actions/cache/pull/1041) ##### New Contributors - [@​kotokaze](https://togithub.com/kotokaze) made their first contribution in [https://github.com/actions/cache/pull/1123](https://togithub.com/actions/cache/pull/1123) **Full Changelog**: actions/cache@v3...v3.3.0 ### [`v3.2.6`](https://togithub.com/actions/cache/releases/tag/v3.2.6) [Compare Source](https://togithub.com/actions/cache/compare/v3.2.5...v3.2.6) ##### What's Changed - Updated branch in Force deletion of caches by [@​t-dedah](https://togithub.com/t-dedah) in [https://github.com/actions/cache/pull/1108](https://togithub.com/actions/cache/pull/1108) - Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners by [@​pdotl](https://togithub.com/pdotl) in [https://github.com/actions/cache/pull/1118](https://togithub.com/actions/cache/pull/1118) **Full Changelog**: actions/cache@v3...v3.2.6 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Hapag-Lloyd/terraform-aws-bastion-host-ssm). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Add new actions/cache version (with dryRun support) * Add dry-run option * Changes after rebase * Update readme * Rename option to lookup-only * Update test name * Update package.json + changelog * Update README * Update custom package version * Update custom package version * Update @actions/cache to 3.2.0 * Code review * Update log statement * Move test case --------- Co-authored-by: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com>
Description
Add an advanced option to skip downloading the cache entry.
Motivation and Context
Fixes #901
Fixes #831
#1020 (comment)
#1020 (comment)
If dependency install / cache setup and the actual tests are split across multiple jobs, it's often unnecessary to restore the cache if an exact cache-hit occurred. Similarly, if the cache is created from scratch, it's only necessary to know if a cache entry already exists.
Using
lookup-only
in these cases saves time and resources, especially for larger caches which don't need to be restored.How Has This Been Tested?
Added test case and run a test workflow using the feature branch.
Screenshots (if appropriate):
--
Types of changes
Checklist: