From af1210e2a34a4721a2fd8e47ee0b3b419613bd04 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Tue, 29 Nov 2022 09:51:53 +0000 Subject: [PATCH] test --- dist/restore-only/index.js | 133 +++++++++++++++--------------- dist/restore/index.js | 32 ++++++- package.json | 2 +- src/restore-step.ts | 7 ++ src/restore.ts | 2 - src/{ => restore}/restore-only.ts | 4 +- 6 files changed, 105 insertions(+), 75 deletions(-) create mode 100644 src/restore-step.ts rename src/{ => restore}/restore-only.ts (91%) diff --git a/dist/restore-only/index.js b/dist/restore-only/index.js index 03d0ae0..56c3353 100644 --- a/dist/restore-only/index.js +++ b/dist/restore-only/index.js @@ -34,7 +34,7 @@ module.exports = /******/ // the startup function /******/ function startup() { /******/ // Load entry module and return exports -/******/ return __webpack_require__(396); +/******/ return __webpack_require__(501); /******/ }; /******/ /******/ // run startup @@ -36715,70 +36715,7 @@ exports.ProxyTracerProvider = ProxyTracerProvider; /***/ }), /* 395 */, -/* 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"); - - -/***/ }), +/* 396 */, /* 397 */, /* 398 */ /***/ (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 */, /* 503 */, /* 504 */, @@ -49108,7 +49108,6 @@ function run() { } }); } -// run(); exports.default = run; diff --git a/dist/restore/index.js b/dist/restore/index.js index aa390fa..1e8a05b 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -34,7 +34,7 @@ module.exports = /******/ // the startup function /******/ function startup() { /******/ // Load entry module and return exports -/******/ return __webpack_require__(778); +/******/ return __webpack_require__(156); /******/ }; /******/ /******/ // run startup @@ -4612,7 +4612,34 @@ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { /* 153 */, /* 154 */, /* 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 */ /***/ (function(module, __unusedexports, __webpack_require__) { @@ -49045,7 +49072,6 @@ function run() { } }); } -// run(); exports.default = run; diff --git a/package.json b/package.json index 7e45b86..22168b6 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "Cache dependencies and build outputs", "main": "dist/restore/index.js", "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", "lint": "eslint **/*.ts --cache", "format": "prettier --write **/*.ts", diff --git a/src/restore-step.ts b/src/restore-step.ts new file mode 100644 index 0000000..c894874 --- /dev/null +++ b/src/restore-step.ts @@ -0,0 +1,7 @@ +import restore from "./restore"; + +async function runRestoreStep(): Promise { + await restore(); +} + +runRestoreStep(); diff --git a/src/restore.ts b/src/restore.ts index 52055c7..5f695dd 100644 --- a/src/restore.ts +++ b/src/restore.ts @@ -76,6 +76,4 @@ async function run(): Promise { } } -// run(); - export default run; diff --git a/src/restore-only.ts b/src/restore/restore-only.ts similarity index 91% rename from src/restore-only.ts rename to src/restore/restore-only.ts index 6e8f64e..49a7aad 100644 --- a/src/restore-only.ts +++ b/src/restore/restore-only.ts @@ -1,7 +1,7 @@ import * as core from "@actions/core"; -import { Inputs } from "./constants"; -import restore from "./restore"; +import { Inputs } from "../constants"; +import restore from "../restore"; async function runRestoreAction(): Promise { if (core.getInput(Inputs.SaveOnAnyFailure) != "") {