Skip to content

Commit

Permalink
bump cache version
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed May 8, 2023
1 parent 8f7008b commit b67cbdb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __tests__/cache-restore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('cache-restore', () => {
await restoreCache(packageManager);
expect(hashFilesSpy).toHaveBeenCalled();
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: node-cache-${platform}-${packageManager}-${fileHash}`
`Cache restored from key: node-cache-${platform}-${packageManager}-v2-${fileHash}`
);
expect(infoSpy).not.toHaveBeenCalledWith(
`${packageManager} cache is not found`
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71152,7 +71152,7 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
if (!fileHash) {
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
}
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
const primaryKey = `node-cache-${platform}-${packageManager}-v2-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const cacheKey = yield cache.restoreCache([cachePath], primaryKey);
Expand Down
3 changes: 1 addition & 2 deletions src/cache-restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {State} from './constants';
import {
getCacheDirectoryPath,
getPackageManagerInfo,
getPackageManagerWorkingDir,
PackageManagerInfo
} from './cache-utils';

Expand Down Expand Up @@ -37,7 +36,7 @@ export const restoreCache = async (
);
}

const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
const primaryKey = `node-cache-${platform}-${packageManager}-v2-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);

core.saveState(State.CachePrimaryKey, primaryKey);
Expand Down

0 comments on commit b67cbdb

Please sign in to comment.