Compare commits

..

3 Commits

Author SHA1 Message Date
Ryo Mimura
8addae5fff fix: Output chache hit timing 2024-06-21 05:44:37 +09:00
Ryo Mimura
6f5b5ee729 fix: Output chache hit timing 2024-06-21 00:09:16 +09:00
Ryo Mimura
688d5d4688 fix: cache-hit output 2024-05-22 11:42:10 +09:00
9 changed files with 16609 additions and 267286 deletions

View File

@@ -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}`

View File

@@ -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(

File diff suppressed because one or more lines are too long

70726
dist/restore/index.js vendored

File diff suppressed because one or more lines are too long

70725
dist/save-only/index.js vendored

File diff suppressed because one or more lines are too long

70725
dist/save/index.js vendored

File diff suppressed because one or more lines are too long

978
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -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",

View File

@@ -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;
}