1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-11-30 23:59:16 +01:00
This commit is contained in:
Sankalp Kotewar 2022-11-29 09:51:53 +00:00 committed by GitHub
parent ab0e7714ce
commit af1210e2a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 105 additions and 75 deletions

View file

@ -34,7 +34,7 @@ module.exports =
/******/ // the startup function /******/ // the startup function
/******/ function startup() { /******/ function startup() {
/******/ // Load entry module and return exports /******/ // Load entry module and return exports
/******/ return __webpack_require__(396); /******/ return __webpack_require__(501);
/******/ }; /******/ };
/******/ /******/
/******/ // run startup /******/ // run startup
@ -36715,70 +36715,7 @@ exports.ProxyTracerProvider = ProxyTracerProvider;
/***/ }), /***/ }),
/* 395 */, /* 395 */,
/* 396 */ /* 396 */,
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const constants_1 = __webpack_require__(694);
const restore_1 = __importDefault(__webpack_require__(778));
function runRestoreAction() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(constants_1.Inputs.SaveOnAnyFailure) != "") {
core.warning(`${constants_1.Inputs.SaveOnAnyFailure} value is passed in the input, this input is invalid for the restore-only action and hence will be ignored`);
}
if (core.getInput(constants_1.Inputs.UploadChunkSize) != "") {
core.warning(`${constants_1.Inputs.UploadChunkSize} value is passed in the input, this input is invalid for the restore-only action and hence will be ignored`);
}
core.info("before run");
yield (0, restore_1.default)();
core.info("after run");
});
}
core.info("before runRestoreAction");
runRestoreAction();
core.info("after runRestoreAction");
core.info("after export default runRestoreAction");
/***/ }),
/* 397 */, /* 397 */,
/* 398 */ /* 398 */
/***/ (function(__unusedmodule, exports, __webpack_require__) { /***/ (function(__unusedmodule, exports, __webpack_require__) {
@ -41355,7 +41292,70 @@ function defer(fn)
/***/ }), /***/ }),
/* 501 */, /* 501 */
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const constants_1 = __webpack_require__(694);
const restore_1 = __importDefault(__webpack_require__(778));
function runRestoreAction() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(constants_1.Inputs.SaveOnAnyFailure) != "") {
core.warning(`${constants_1.Inputs.SaveOnAnyFailure} value is passed in the input, this input is invalid for the restore-only action and hence will be ignored`);
}
if (core.getInput(constants_1.Inputs.UploadChunkSize) != "") {
core.warning(`${constants_1.Inputs.UploadChunkSize} value is passed in the input, this input is invalid for the restore-only action and hence will be ignored`);
}
core.info("before run");
yield (0, restore_1.default)();
core.info("after run");
});
}
core.info("before runRestoreAction");
runRestoreAction();
core.info("after runRestoreAction");
core.info("after export default runRestoreAction");
/***/ }),
/* 502 */, /* 502 */,
/* 503 */, /* 503 */,
/* 504 */, /* 504 */,
@ -49108,7 +49108,6 @@ function run() {
} }
}); });
} }
// run();
exports.default = run; exports.default = run;

32
dist/restore/index.js vendored
View file

@ -34,7 +34,7 @@ module.exports =
/******/ // the startup function /******/ // the startup function
/******/ function startup() { /******/ function startup() {
/******/ // Load entry module and return exports /******/ // Load entry module and return exports
/******/ return __webpack_require__(778); /******/ return __webpack_require__(156);
/******/ }; /******/ };
/******/ /******/
/******/ // run startup /******/ // run startup
@ -4612,7 +4612,34 @@ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
/* 153 */, /* 153 */,
/* 154 */, /* 154 */,
/* 155 */, /* 155 */,
/* 156 */, /* 156 */
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const restore_1 = __importDefault(__webpack_require__(778));
function runRestoreStep() {
return __awaiter(this, void 0, void 0, function* () {
yield (0, restore_1.default)();
});
}
runRestoreStep();
/***/ }),
/* 157 */ /* 157 */
/***/ (function(module, __unusedexports, __webpack_require__) { /***/ (function(module, __unusedexports, __webpack_require__) {
@ -49045,7 +49072,6 @@ function run() {
} }
}); });
} }
// run();
exports.default = run; exports.default = run;

View file

@ -5,7 +5,7 @@
"description": "Cache dependencies and build outputs", "description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js", "main": "dist/restore/index.js",
"scripts": { "scripts": {
"build": "tsc && ncc build -o dist/restore src/restore.ts && ncc build -o dist/save src/save.ts && ncc build -o dist/restore-only src/restore-only.ts", "build": "tsc && ncc build -o dist/restore src/restore-step.ts && ncc build -o dist/save src/save.ts && ncc build -o dist/restore-only src/restore/restore-only.ts",
"test": "tsc --noEmit && jest --coverage", "test": "tsc --noEmit && jest --coverage",
"lint": "eslint **/*.ts --cache", "lint": "eslint **/*.ts --cache",
"format": "prettier --write **/*.ts", "format": "prettier --write **/*.ts",

7
src/restore-step.ts Normal file
View file

@ -0,0 +1,7 @@
import restore from "./restore";
async function runRestoreStep(): Promise<void> {
await restore();
}
runRestoreStep();

View file

@ -76,6 +76,4 @@ async function run(): Promise<void> {
} }
} }
// run();
export default run; export default run;

View file

@ -1,7 +1,7 @@
import * as core from "@actions/core"; import * as core from "@actions/core";
import { Inputs } from "./constants"; import { Inputs } from "../constants";
import restore from "./restore"; import restore from "../restore";
async function runRestoreAction(): Promise<void> { async function runRestoreAction(): Promise<void> {
if (core.getInput(Inputs.SaveOnAnyFailure) != "") { if (core.getInput(Inputs.SaveOnAnyFailure) != "") {