mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-20 15:53:59 +08:00
Add lookup-only
option (#1041)
* 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>
This commit is contained in:
parent
e0d62270e2
commit
940f3d7cf1
18 changed files with 260 additions and 47 deletions
|
@ -74,7 +74,15 @@ test("restore with no cache found", async () => {
|
|||
await run();
|
||||
|
||||
expect(restoreCacheMock).toHaveBeenCalledTimes(1);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith(
|
||||
[path],
|
||||
key,
|
||||
[],
|
||||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
expect(stateMock).toHaveBeenCalledTimes(1);
|
||||
|
@ -113,7 +121,9 @@ test("restore with restore keys and no cache found", async () => {
|
|||
[path],
|
||||
key,
|
||||
[restoreKey],
|
||||
{},
|
||||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
|
@ -149,7 +159,15 @@ test("restore with cache found for key", async () => {
|
|||
await run();
|
||||
|
||||
expect(restoreCacheMock).toHaveBeenCalledTimes(1);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith(
|
||||
[path],
|
||||
key,
|
||||
[],
|
||||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", key);
|
||||
|
@ -190,7 +208,9 @@ test("restore with cache found for restore key", async () => {
|
|||
[path],
|
||||
key,
|
||||
[restoreKey],
|
||||
{},
|
||||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
|
@ -233,7 +253,9 @@ test("Fail restore when fail on cache miss is enabled and primary + restore keys
|
|||
[path],
|
||||
key,
|
||||
[restoreKey],
|
||||
{},
|
||||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
|
@ -274,7 +296,9 @@ test("restore when fail on cache miss is enabled and primary key doesn't match r
|
|||
[path],
|
||||
key,
|
||||
[restoreKey],
|
||||
{},
|
||||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
|
@ -318,7 +342,9 @@ test("restore with fail on cache miss disabled and no cache found", async () =>
|
|||
[path],
|
||||
key,
|
||||
[restoreKey],
|
||||
{},
|
||||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue