review updates second stage

This commit is contained in:
Sergey Dolin 2023-06-14 19:42:28 +02:00
parent 6aacde798c
commit 3ef527264a
6 changed files with 25 additions and 83 deletions

27
dist/setup/index.js vendored
View file

@ -71153,7 +71153,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}-v2-${fileHash}`;
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey);
@ -71217,7 +71217,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isCacheFeatureAvailable = exports.isGhes = exports.getCacheDirectories = exports.memoizedCacheDependencies = exports.getPackageManagerInfo = exports.getCommandOutputNotEmpty = exports.getCommandOutput = exports.supportedPackageManagers = void 0;
exports.isCacheFeatureAvailable = exports.isGhes = exports.getCacheDirectories = exports.getPackageManagerInfo = exports.getCommandOutputNotEmpty = exports.getCommandOutput = exports.supportedPackageManagers = void 0;
const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514));
const cache = __importStar(__nccwpck_require__(7799));
@ -71286,11 +71286,6 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void
}
});
exports.getPackageManagerInfo = getPackageManagerInfo;
/**
* glob expanding memoized because it involves potentially very deep
* traversing through the directories tree
*/
exports.memoizedCacheDependencies = {};
/**
* Expands (converts) the string input `cache-dependency-path` to list of directories that
* may be project roots
@ -71299,27 +71294,15 @@ exports.memoizedCacheDependencies = {};
* @return list of directories and possible
*/
const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
let cacheDependenciesPaths;
// memoize unglobbed paths to avoid traversing FS
const memoized = exports.memoizedCacheDependencies[cacheDependencyPath];
if (memoized) {
cacheDependenciesPaths = memoized;
}
else {
const globber = yield glob.create(cacheDependencyPath);
cacheDependenciesPaths = yield globber.glob();
exports.memoizedCacheDependencies[cacheDependencyPath] = cacheDependenciesPaths;
}
const globber = yield glob.create(cacheDependencyPath);
const cacheDependenciesPaths = yield globber.glob();
const existingDirectories = cacheDependenciesPaths
.map(path_1.default.dirname)
.filter(util_1.unique())
.filter(fs_1.default.existsSync)
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
// if user explicitly pointed out some file, but it does not exist it is definitely
// not he wanted, thus we should throw an error not trying to workaround with unexpected
// result to the whole build
if (!existingDirectories.length)
throw Error('No existing directories found containing `cache-dependency-path`="${cacheDependencyPath}"');
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
return existingDirectories;
});
/**