diff --git a/__tests__/cache-utils.test.ts b/__tests__/cache-utils.test.ts index 39f376f..a8c881e 100644 --- a/__tests__/cache-utils.test.ts +++ b/__tests__/cache-utils.test.ts @@ -23,8 +23,10 @@ describe('cache-utils', () => { let isFeatureAvailable: jest.SpyInstance; let info: jest.SpyInstance; let warningSpy: jest.SpyInstance; + let fsRealPathSyncSpy: jest.SpyInstance; beforeEach(() => { + console.log('::stop-commands::stoptoken'); process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data'); debugSpy = jest.spyOn(core, 'debug'); debugSpy.mockImplementation(msg => {}); @@ -35,8 +37,24 @@ describe('cache-utils', () => { isFeatureAvailable = jest.spyOn(cache, 'isFeatureAvailable'); getCommandOutputSpy = jest.spyOn(utils, 'getCommandOutput'); + + fsRealPathSyncSpy = jest.spyOn(fs, 'realpathSync'); + fsRealPathSyncSpy.mockImplementation(dirName => { + return dirName; + }); }); + afterEach(() => { + jest.resetAllMocks(); + jest.clearAllMocks(); + //jest.restoreAllMocks(); + }); + + afterAll(async () => { + console.log('::stoptoken::'); + jest.restoreAllMocks(); + }, 100000); + describe('getPackageManagerInfo', () => { it.each<[string, PackageManagerInfo | null]>([ ['npm', utils.supportedPackageManagers.npm], diff --git a/__tests__/nightly-installer.test.ts b/__tests__/nightly-installer.test.ts index 04a3253..87c4379 100644 --- a/__tests__/nightly-installer.test.ts +++ b/__tests__/nightly-installer.test.ts @@ -95,6 +95,8 @@ describe('setup-node', () => { res = nodeTestDistRc; } else if (url.includes('/nightly')) { res = nodeTestDistNightly; + } else if (url.includes('/v8-canary')) { + res = nodeV8CanaryTestDist; } else { res = nodeTestDist; } diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 2db4b66..1b205cd 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -60556,6 +60556,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __ const existingDirectories = cacheDependenciesPaths .map(path_1.default.dirname) .filter(util_1.unique()) + .map(dirName => fs_1.default.realpathSync(dirName)) .filter(directory => fs_1.default.lstatSync(directory).isDirectory()); if (!existingDirectories.length) core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`); diff --git a/dist/setup/index.js b/dist/setup/index.js index 6800527..5d2b235 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71343,6 +71343,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __ const existingDirectories = cacheDependenciesPaths .map(path_1.default.dirname) .filter(util_1.unique()) + .map(dirName => fs_1.default.realpathSync(dirName)) .filter(directory => fs_1.default.lstatSync(directory).isDirectory()); if (!existingDirectories.length) core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`); diff --git a/src/cache-utils.ts b/src/cache-utils.ts index 8d25c36..7066d73 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -144,6 +144,7 @@ const getProjectDirectoriesFromCacheDependencyPath = async ( const existingDirectories: string[] = cacheDependenciesPaths .map(path.dirname) .filter(unique()) + .map(dirName => fs.realpathSync(dirName)) .filter(directory => fs.lstatSync(directory).isDirectory()); if (!existingDirectories.length)