check failures fix

This commit is contained in:
Aparna Jyothi 2025-05-26 16:17:07 +05:30
parent 23543aaee9
commit 5f0e3d56e0
2 changed files with 1016 additions and 1100 deletions

View File

@ -86644,22 +86644,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return ownKeys(o);
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } };
return new (P || (P = Promise))(function (resolve, reject) { return function (mod) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } if (mod && mod.__esModule) return mod;
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } var result = {};
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
step((generator = generator.apply(thisArg, _arguments || [])).next()); __setModuleDefault(result, mod);
}); return result;
}; };
})();
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.State = void 0; exports.State = void 0;
const cache = __importStar(__nccwpck_require__(5116)); const cache = __importStar(__nccwpck_require__(5116));
@ -86677,36 +86678,32 @@ class CacheDistributor {
this.cacheDependencyPath = cacheDependencyPath; this.cacheDependencyPath = cacheDependencyPath;
this.CACHE_KEY_PREFIX = 'setup-python'; this.CACHE_KEY_PREFIX = 'setup-python';
} }
handleLoadedCache() { async handleLoadedCache() { }
return __awaiter(this, void 0, void 0, function* () { }); async restoreCache() {
} const { primaryKey, restoreKey } = await this.computeKeys();
restoreCache() { if (primaryKey.endsWith('-')) {
return __awaiter(this, void 0, void 0, function* () { const file = this.packageManager === 'pip'
const { primaryKey, restoreKey } = yield this.computeKeys(); ? `${this.cacheDependencyPath
if (primaryKey.endsWith('-')) { .split('\n')
const file = this.packageManager === 'pip' .join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}`
? `${this.cacheDependencyPath : this.cacheDependencyPath.split('\n').join(',');
.split('\n') throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`);
.join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}` }
: this.cacheDependencyPath.split('\n').join(','); const cachePath = await this.getCacheGlobalDirectories();
throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`); core.saveState(State.CACHE_PATHS, cachePath);
} let matchedKey;
const cachePath = yield this.getCacheGlobalDirectories(); try {
core.saveState(State.CACHE_PATHS, cachePath); matchedKey = await cache.restoreCache(cachePath, primaryKey, restoreKey);
let matchedKey; }
try { catch (err) {
matchedKey = yield cache.restoreCache(cachePath, primaryKey, restoreKey); const message = err.message;
} core.info(`[warning]${message}`);
catch (err) { core.setOutput('cache-hit', false);
const message = err.message; return;
core.info(`[warning]${message}`); }
core.setOutput('cache-hit', false); core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);
return; await this.handleLoadedCache();
} this.handleMatchResult(matchedKey, primaryKey);
core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);
yield this.handleLoadedCache();
this.handleMatchResult(matchedKey, primaryKey);
});
} }
handleMatchResult(matchedKey, primaryKey) { handleMatchResult(matchedKey, primaryKey) {
if (matchedKey) { if (matchedKey) {
@ -86757,27 +86754,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return ownKeys(o);
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } };
return new (P || (P = Promise))(function (resolve, reject) { return function (mod) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } if (mod && mod.__esModule) return mod;
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } var result = {};
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
step((generator = generator.apply(thisArg, _arguments || [])).next()); __setModuleDefault(result, mod);
}); return result;
}; };
})();
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.run = void 0; exports.run = run;
const core = __importStar(__nccwpck_require__(7484)); const core = __importStar(__nccwpck_require__(7484));
const cache = __importStar(__nccwpck_require__(5116)); const cache = __importStar(__nccwpck_require__(5116));
const fs_1 = __importDefault(__nccwpck_require__(9896)); const fs_1 = __importDefault(__nccwpck_require__(9896));
@ -86785,61 +86783,56 @@ const cache_distributor_1 = __nccwpck_require__(2326);
// Added early exit to resolve issue with slow post action step: // Added early exit to resolve issue with slow post action step:
// - https://github.com/actions/setup-node/issues/878 // - https://github.com/actions/setup-node/issues/878
// https://github.com/actions/cache/pull/1217 // https://github.com/actions/cache/pull/1217
function run(earlyExit) { async function run(earlyExit) {
return __awaiter(this, void 0, void 0, function* () { try {
try { const cache = core.getInput('cache');
const cache = core.getInput('cache'); if (cache) {
if (cache) { await saveCache(cache);
yield saveCache(cache); if (earlyExit) {
if (earlyExit) { process.exit(0);
process.exit(0);
}
} }
} }
catch (error) { }
const err = error; catch (error) {
core.setFailed(err.message); const err = error;
} core.setFailed(err.message);
}); }
} }
exports.run = run; async function saveCache(packageManager) {
function saveCache(packageManager) { const cachePathState = core.getState(cache_distributor_1.State.CACHE_PATHS);
return __awaiter(this, void 0, void 0, function* () { if (!cachePathState) {
const cachePathState = core.getState(cache_distributor_1.State.CACHE_PATHS); core.warning('Cache paths are empty. Please check the previous logs and make sure that the python version is specified');
if (!cachePathState) { return;
core.warning('Cache paths are empty. Please check the previous logs and make sure that the python version is specified'); }
return; const cachePaths = JSON.parse(cachePathState);
} core.debug(`paths for caching are ${cachePaths.join(', ')}`);
const cachePaths = JSON.parse(cachePathState); if (!isCacheDirectoryExists(cachePaths)) {
core.debug(`paths for caching are ${cachePaths.join(', ')}`); throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`);
if (!isCacheDirectoryExists(cachePaths)) { }
throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`); const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY);
} const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY);
const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY); if (!primaryKey) {
const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY); core.warning('Error retrieving key from state.');
if (!primaryKey) { return;
core.warning('Error retrieving key from state.'); }
return; else if (matchedKey === primaryKey) {
} // no change in target directories
else if (matchedKey === primaryKey) { core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
// no change in target directories return;
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`); }
return; let cacheId = 0;
} try {
let cacheId = 0; cacheId = await cache.saveCache(cachePaths, primaryKey);
try { }
cacheId = yield cache.saveCache(cachePaths, primaryKey); catch (err) {
} const message = err.message;
catch (err) { core.info(`[warning]${message}`);
const message = err.message; return;
core.info(`[warning]${message}`); }
return; if (cacheId == -1) {
} return;
if (cacheId == -1) { }
return; core.info(`Cache saved with the key: ${primaryKey}`);
}
core.info(`Cache saved with the key: ${primaryKey}`);
});
} }
function isCacheDirectoryExists(cacheDirectory) { function isCacheDirectoryExists(cacheDirectory) {
const result = cacheDirectory.reduce((previousValue, currentValue) => { const result = cacheDirectory.reduce((previousValue, currentValue) => {

1893
dist/setup/index.js vendored

File diff suppressed because it is too large Load Diff