Bump version to 2.2.0

This commit is contained in:
Shivam Mathur 2020-05-08 05:41:00 +05:30
parent 3ec1728de8
commit d10d1e249b
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
9 changed files with 1791 additions and 821 deletions

View File

@ -1,11 +1,12 @@
{ {
"arrowParens": "avoid",
"bracketSpacing": false,
"endOfLine": "auto",
"parser": "typescript",
"printWidth": 80, "printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true, "semi": true,
"singleQuote": true, "singleQuote": true,
"tabWidth": 2,
"trailingComma": "none", "trailingComma": "none",
"bracketSpacing": false, "useTabs": false
"arrowParens": "avoid", }
"parser": "typescript"
}

View File

@ -29,7 +29,9 @@ describe('Utils tests', () => {
it('checking asyncForEach', async () => { it('checking asyncForEach', async () => {
const array: Array<string> = ['a', 'b', 'c']; const array: Array<string> = ['a', 'b', 'c'];
let concat = ''; let concat = '';
await utils.asyncForEach(array, async function(str: string): Promise<void> { await utils.asyncForEach(array, async function (
str: string
): Promise<void> {
concat += str; concat += str;
}); });
expect(concat).toBe('abc'); expect(concat).toBe('abc');
@ -68,7 +70,10 @@ describe('Utils tests', () => {
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || ''; const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
const script_path: string = path.join(runner_dir, 'test.sh'); const script_path: string = path.join(runner_dir, 'test.sh');
await utils.writeScript('test.sh', testString); await utils.writeScript('test.sh', testString);
await fs.readFile(script_path, function(error: Error | null, data: Buffer) { await fs.readFile(script_path, function (
error: Error | null,
data: Buffer
) {
expect(testString).toBe(data.toString()); expect(testString).toBe(data.toString());
}); });
await cleanup(script_path); await cleanup(script_path);

119
dist/index.js vendored
View File

@ -952,14 +952,27 @@ class ExecState extends events.EventEmitter {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.addMatchers = void 0;
const path = __importStar(__webpack_require__(622)); const path = __importStar(__webpack_require__(622));
const utils = __importStar(__webpack_require__(163)); const utils = __importStar(__webpack_require__(163));
const io = __importStar(__webpack_require__(1)); const io = __importStar(__webpack_require__(1));
@ -996,14 +1009,27 @@ module.exports = require("child_process");
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.suppressOutput = exports.getExtensionPrefix = exports.CSVArray = exports.extensionArray = exports.writeScript = exports.readScript = exports.addLog = exports.stepLog = exports.log = exports.color = exports.asyncForEach = exports.getInput = void 0;
const fs = __importStar(__webpack_require__(747)); const fs = __importStar(__webpack_require__(747));
const path = __importStar(__webpack_require__(622)); const path = __importStar(__webpack_require__(622));
const core = __importStar(__webpack_require__(470)); const core = __importStar(__webpack_require__(470));
@ -1558,14 +1584,27 @@ exports.getState = getState;
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.addTools = exports.addPackage = exports.addDevTools = exports.addArchive = exports.getCleanedToolsList = exports.addComposer = exports.getWpCliUrl = exports.getSymfonyUri = exports.getDeployerUrl = exports.getPharUrl = exports.addPhive = exports.getCodeceptionUri = exports.getCodeceptionUriBuilder = exports.getUri = exports.parseTool = exports.getToolVersion = exports.getCommand = void 0;
const utils = __importStar(__webpack_require__(163)); const utils = __importStar(__webpack_require__(163));
/** /**
* Function to get command to setup tools * Function to get command to setup tools
@ -2042,14 +2081,27 @@ module.exports = require("path");
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.addCoverage = exports.disableCoverage = exports.addCoveragePCOV = exports.addCoverageXdebug = void 0;
const utils = __importStar(__webpack_require__(163)); const utils = __importStar(__webpack_require__(163));
const extensions = __importStar(__webpack_require__(911)); const extensions = __importStar(__webpack_require__(911));
const config = __importStar(__webpack_require__(641)); const config = __importStar(__webpack_require__(641));
@ -2168,14 +2220,27 @@ exports.addCoverage = addCoverage;
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.addINIValues = exports.addINIValuesWindows = exports.addINIValuesUnix = void 0;
const utils = __importStar(__webpack_require__(163)); const utils = __importStar(__webpack_require__(163));
/** /**
* Add script to set custom ini values for unix * Add script to set custom ini values for unix
@ -2251,14 +2316,27 @@ exports.addINIValues = addINIValues;
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.run = exports.build = void 0;
const exec_1 = __webpack_require__(986); const exec_1 = __webpack_require__(986);
const core = __importStar(__webpack_require__(470)); const core = __importStar(__webpack_require__(470));
const config = __importStar(__webpack_require__(641)); const config = __importStar(__webpack_require__(641));
@ -2556,14 +2634,27 @@ module.exports = require("fs");
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
result["default"] = mod; __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.addExtension = exports.addExtensionLinux = exports.addExtensionWindows = exports.addExtensionDarwin = void 0;
const path = __importStar(__webpack_require__(622)); const path = __importStar(__webpack_require__(622));
const utils = __importStar(__webpack_require__(163)); const utils = __importStar(__webpack_require__(163));
/** /**

2419
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.1.4", "version": "2.2.0",
"private": false, "private": false,
"description": "Setup PHP for use with GitHub Actions", "description": "Setup PHP for use with GitHub Actions",
"main": "dist/index.js", "main": "dist/index.js",
@ -24,28 +24,28 @@
"author": "shivammathur", "author": "shivammathur",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.3", "@actions/core": "^1.2.4",
"@actions/exec": "^1.0.3", "@actions/exec": "^1.0.4",
"@actions/io": "^1.0.2", "@actions/io": "^1.0.2",
"fs": "0.0.1-security" "fs": "0.0.1-security"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^25.2.1", "@types/jest": "^25.2.1",
"@types/node": "^13.11.1", "@types/node": "^14.0.1",
"@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.27.0", "@typescript-eslint/parser": "^2.33.0",
"@zeit/ncc": "^0.22.1", "@zeit/ncc": "^0.22.1",
"eslint": "^6.8.0", "eslint": "^7.0.0",
"eslint-config-prettier": "^6.10.1", "eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2", "eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.8.2", "eslint-plugin-jest": "^23.11.0",
"eslint-plugin-prettier": "^3.1.2", "eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.3", "husky": "^4.2.5",
"jest": "^25.3.0", "jest": "^26.0.1",
"jest-circus": "^25.3.0", "jest-circus": "^26.0.1",
"prettier": "^1.19.1", "prettier": "^2.0.5",
"ts-jest": "^25.3.1", "ts-jest": "^25.5.1",
"typescript": "^3.8.3" "typescript": "^3.9.2"
}, },
"husky": { "husky": {
"skipCI": true, "skipCI": true,

View File

@ -10,7 +10,7 @@ export async function addINIValuesUnix(
): Promise<string> { ): Promise<string> {
const ini_values: Array<string> = await utils.CSVArray(ini_values_csv); const ini_values: Array<string> = await utils.CSVArray(ini_values_csv);
let script = '\n'; let script = '\n';
await utils.asyncForEach(ini_values, async function(line: string) { await utils.asyncForEach(ini_values, async function (line: string) {
script += script +=
(await utils.addLog('$tick', line, 'Added to php.ini', 'linux')) + '\n'; (await utils.addLog('$tick', line, 'Added to php.ini', 'linux')) + '\n';
}); });
@ -27,7 +27,7 @@ export async function addINIValuesWindows(
): Promise<string> { ): Promise<string> {
const ini_values: Array<string> = await utils.CSVArray(ini_values_csv); const ini_values: Array<string> = await utils.CSVArray(ini_values_csv);
let script = '\n'; let script = '\n';
await utils.asyncForEach(ini_values, async function(line: string) { await utils.asyncForEach(ini_values, async function (line: string) {
script += script +=
(await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n'; (await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n';
}); });

View File

@ -16,7 +16,7 @@ export async function addExtensionDarwin(
const extensions: Array<string> = await utils.extensionArray(extension_csv); const extensions: Array<string> = await utils.extensionArray(extension_csv);
let add_script = '\n'; let add_script = '\n';
let remove_script = '\n'; let remove_script = '\n';
await utils.asyncForEach(extensions, async function(extension: string) { await utils.asyncForEach(extensions, async function (extension: string) {
const version_extension: string = version + extension; const version_extension: string = version + extension;
const [ext_name, ext_version]: string[] = extension.split('-'); const [ext_name, ext_version]: string[] = extension.split('-');
const ext_prefix = await utils.getExtensionPrefix(ext_name); const ext_prefix = await utils.getExtensionPrefix(ext_name);
@ -128,7 +128,7 @@ export async function addExtensionWindows(
const extensions: Array<string> = await utils.extensionArray(extension_csv); const extensions: Array<string> = await utils.extensionArray(extension_csv);
let add_script = '\n'; let add_script = '\n';
let remove_script = '\n'; let remove_script = '\n';
await utils.asyncForEach(extensions, async function(extension: string) { await utils.asyncForEach(extensions, async function (extension: string) {
const [ext_name, ext_version]: string[] = extension.split('-'); const [ext_name, ext_version]: string[] = extension.split('-');
const version_extension: string = version + extension; const version_extension: string = version + extension;
let matches: RegExpExecArray; let matches: RegExpExecArray;
@ -220,7 +220,7 @@ export async function addExtensionLinux(
const extensions: Array<string> = await utils.extensionArray(extension_csv); const extensions: Array<string> = await utils.extensionArray(extension_csv);
let add_script = '\n'; let add_script = '\n';
let remove_script = '\n'; let remove_script = '\n';
await utils.asyncForEach(extensions, async function(extension: string) { await utils.asyncForEach(extensions, async function (extension: string) {
const version_extension: string = version + extension; const version_extension: string = version + extension;
const [ext_name, ext_version]: string[] = extension.split('-'); const [ext_name, ext_version]: string[] = extension.split('-');
const ext_prefix = await utils.getExtensionPrefix(ext_name); const ext_prefix = await utils.getExtensionPrefix(ext_name);

View File

@ -324,7 +324,7 @@ export async function getCleanedToolsList(
let tools_list: string[] = await utils.CSVArray(tools_csv); let tools_list: string[] = await utils.CSVArray(tools_csv);
tools_list = await addComposer(tools_list); tools_list = await addComposer(tools_list);
tools_list = tools_list tools_list = tools_list
.map(function(extension: string) { .map(function (extension: string) {
return extension return extension
.trim() .trim()
.replace( .replace(
@ -420,7 +420,7 @@ export async function addTools(
): Promise<string> { ): Promise<string> {
let script = '\n' + (await utils.stepLog('Setup Tools', os_version)); let script = '\n' + (await utils.stepLog('Setup Tools', os_version));
const tools_list: Array<string> = await getCleanedToolsList(tools_csv); const tools_list: Array<string> = await getCleanedToolsList(tools_csv);
await utils.asyncForEach(tools_list, async function(release: string) { await utils.asyncForEach(tools_list, async function (release: string) {
const tool_data: {name: string; version: string} = await parseTool(release); const tool_data: {name: string; version: string} = await parseTool(release);
const tool: string = tool_data.name; const tool: string = tool_data.name;
const version: string = tool_data.version; const version: string = tool_data.version;

View File

@ -186,7 +186,7 @@ export async function extensionArray(
default: default:
return extension_csv return extension_csv
.split(',') .split(',')
.map(function(extension: string) { .map(function (extension: string) {
return extension return extension
.trim() .trim()
.toLowerCase() .toLowerCase()
@ -211,7 +211,7 @@ export async function CSVArray(values_csv: string): Promise<Array<string>> {
default: default:
return values_csv return values_csv
.split(',') .split(',')
.map(function(value: string) { .map(function (value: string) {
return value.trim(); return value.trim();
}) })
.filter(Boolean); .filter(Boolean);