mirror of
https://github.com/actions/cache.git
synced 2026-06-11 16:53:46 +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(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(0);
|
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
||||||
|
|
||||||
expect(failedMock).toHaveBeenCalledWith(
|
expect(failedMock).toHaveBeenCalledWith(
|
||||||
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`
|
`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).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
expect(outputMock).toHaveBeenCalledTimes(1);
|
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
|
||||||
|
expect(outputMock).toHaveBeenCalledTimes(2);
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
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",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "file:/workspaces/toolkit/packages/cache",
|
"@actions/cache": "^3.2.3",
|
||||||
"@actions/core": "file:/workspaces/toolkit/packages/core",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "file:/workspaces/toolkit/packages/exec",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "file:/workspaces/toolkit/packages/io"
|
"@actions/io": "^1.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.5.2",
|
"@types/jest": "^27.5.2",
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export async function restoreImpl(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
|
core.setOutput(Outputs.CacheHit, false.toString());
|
||||||
if (failOnCacheMiss) {
|
if (failOnCacheMiss) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`
|
`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
|
...restoreKeys
|
||||||
].join(", ")}`
|
].join(", ")}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user