mirror of
https://github.com/actions/cache.git
synced 2026-03-04 08:31:03 +08:00
Compare commits
No commits in common. "8addae5ffffa871c88fbd2d8a9a43af45f069161" and "688d5d46889fab7d248142e89a05397103e09377" have entirely different histories.
8addae5fff
...
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(1);
|
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
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}`
|
||||||
|
|||||||
2
dist/restore-only/index.js
vendored
2
dist/restore-only/index.js
vendored
@ -59415,7 +59415,6 @@ function restoreImpl(stateProvider, earlyExit) {
|
|||||||
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
|
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
|
||||||
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
|
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
core.setOutput(constants_1.Outputs.CacheHit, false.toString());
|
|
||||||
if (failOnCacheMiss) {
|
if (failOnCacheMiss) {
|
||||||
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
|
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
|
||||||
}
|
}
|
||||||
@ -59423,6 +59422,7 @@ function restoreImpl(stateProvider, earlyExit) {
|
|||||||
primaryKey,
|
primaryKey,
|
||||||
...restoreKeys
|
...restoreKeys
|
||||||
].join(", ")}`);
|
].join(", ")}`);
|
||||||
|
core.setOutput(constants_1.Outputs.CacheHit, false.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Store the matched cache key in states
|
// Store the matched cache key in states
|
||||||
|
|||||||
2
dist/restore/index.js
vendored
2
dist/restore/index.js
vendored
@ -59415,7 +59415,6 @@ function restoreImpl(stateProvider, earlyExit) {
|
|||||||
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
|
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
|
||||||
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
|
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
core.setOutput(constants_1.Outputs.CacheHit, false.toString());
|
|
||||||
if (failOnCacheMiss) {
|
if (failOnCacheMiss) {
|
||||||
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
|
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
|
||||||
}
|
}
|
||||||
@ -59423,6 +59422,7 @@ function restoreImpl(stateProvider, earlyExit) {
|
|||||||
primaryKey,
|
primaryKey,
|
||||||
...restoreKeys
|
...restoreKeys
|
||||||
].join(", ")}`);
|
].join(", ")}`);
|
||||||
|
core.setOutput(constants_1.Outputs.CacheHit, false.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Store the matched cache key in states
|
// Store the matched cache key in states
|
||||||
|
|||||||
@ -51,7 +51,6 @@ 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}`
|
||||||
@ -63,6 +62,7 @@ export async function restoreImpl(
|
|||||||
...restoreKeys
|
...restoreKeys
|
||||||
].join(", ")}`
|
].join(", ")}`
|
||||||
);
|
);
|
||||||
|
core.setOutput(Outputs.CacheHit, false.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user