mirror of
https://github.com/actions/cache.git
synced 2026-06-08 16:50:28 +08:00
Compare commits
3 Commits
Link-/blob
...
8addae5fff
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8addae5fff | ||
|
|
6f5b5ee729 | ||
|
|
688d5d4688 |
@@ -260,7 +260,7 @@ test("Fail restore when fail on cache miss is enabled and primary + restore keys
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(0);
|
||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
||||
|
||||
expect(failedMock).toHaveBeenCalledWith(
|
||||
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`
|
||||
|
||||
@@ -86,7 +86,8 @@ test("restore with no cache found", async () => {
|
||||
);
|
||||
|
||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||
expect(outputMock).toHaveBeenCalledTimes(1);
|
||||
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
|
||||
expect(outputMock).toHaveBeenCalledTimes(2);
|
||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||
|
||||
expect(infoMock).toHaveBeenCalledWith(
|
||||
|
||||
70726
dist/restore-only/index.js
vendored
70726
dist/restore-only/index.js
vendored
File diff suppressed because one or more lines are too long
70726
dist/restore/index.js
vendored
70726
dist/restore/index.js
vendored
File diff suppressed because one or more lines are too long
70725
dist/save-only/index.js
vendored
70725
dist/save-only/index.js
vendored
File diff suppressed because one or more lines are too long
70725
dist/save/index.js
vendored
70725
dist/save/index.js
vendored
File diff suppressed because one or more lines are too long
978
package-lock.json
generated
978
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -23,10 +23,10 @@
|
||||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "file:/workspaces/toolkit/packages/cache",
|
||||
"@actions/core": "file:/workspaces/toolkit/packages/core",
|
||||
"@actions/exec": "file:/workspaces/toolkit/packages/exec",
|
||||
"@actions/io": "file:/workspaces/toolkit/packages/io"
|
||||
"@actions/cache": "^3.2.3",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/io": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.5.2",
|
||||
|
||||
@@ -51,6 +51,7 @@ export async function restoreImpl(
|
||||
);
|
||||
|
||||
if (!cacheKey) {
|
||||
core.setOutput(Outputs.CacheHit, false.toString());
|
||||
if (failOnCacheMiss) {
|
||||
throw new Error(
|
||||
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`
|
||||
@@ -62,7 +63,6 @@ export async function restoreImpl(
|
||||
...restoreKeys
|
||||
].join(", ")}`
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user