Compare commits

...
9 Commits
Author SHA1 Message Date
Shivam Mathur b84dd3ce25 Remove empty line in logs 2020-05-26 06:41:18 +05:30
Shivam Mathur 190220c10d Create ini file using tee instead of touch 2020-05-22 15:46:30 +05:30
Shivam Mathur 4fb049a68b Merge pull request #225 from shivammathur/develop
2.2.2
2020-05-22 03:46:01 +05:30
Shivam Mathur 3e0678b50f Bump version to 2.2.2 2020-05-22 02:50:45 +05:30
Shivam Mathur 5b06192e7c Improve install.ts tests 2020-05-22 02:50:38 +05:30
Shivam Mathur b419442896 Remove extra newline 2020-05-21 23:33:27 +05:30
Shivam Mathur 49b8b7e301 Update README 2020-05-21 20:43:35 +05:30
Shivam Mathur b1776b79c8 Add support for phan/phan 2020-05-21 11:28:38 +05:30
Shivam Mathur a48ff666f8 Bump version to 2.2.1 2020-05-19 01:18:32 +05:30
11 changed files with 172 additions and 135 deletions
+2 -2
View File
@@ -131,7 +131,7 @@ with:
These tools can be setup globally using the `tools` input. These tools can be setup globally using the `tools` input.
`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `flex`, `infection`, `pecl`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony`, `vapor-cli` `blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `flex`, `infection`, `pecl`, `phan`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony`, `vapor-cli`
```yaml ```yaml
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
@@ -367,7 +367,7 @@ Run the workflow locally with `act` using [`shivammathur/node`](https://github.c
act -P ubuntu-latest=shivammathur/node:latest act -P ubuntu-latest=shivammathur/node:latest
# For runs-on: ubuntu-18.04 # For runs-on: ubuntu-18.04
act -P ubuntu-18.04=shivammathur/node:latest act -P ubuntu-18.04=shivammathur/node:bionic
# For runs-on: ubuntu-16.04 # For runs-on: ubuntu-16.04
act -P ubuntu-16.04=shivammathur/node:xenial act -P ubuntu-16.04=shivammathur/node:xenial
+31 -42
View File
@@ -69,6 +69,7 @@ jest.mock('../src/install', () => ({
* @param extension_csv * @param extension_csv
* @param ini_values_csv * @param ini_values_csv
* @param coverage_driver * @param coverage_driver
* @param tools
*/ */
function setEnv( function setEnv(
version: string | number, version: string | number,
@@ -76,8 +77,7 @@ function setEnv(
extension_csv: string, extension_csv: string,
ini_values_csv: string, ini_values_csv: string,
coverage_driver: string, coverage_driver: string,
tools: string, tools: string
pecl: string
): void { ): void {
process.env['php-version'] = version.toString(); process.env['php-version'] = version.toString();
process.env['RUNNER_OS'] = os; process.env['RUNNER_OS'] = os;
@@ -85,26 +85,25 @@ function setEnv(
process.env['ini-values'] = ini_values_csv; process.env['ini-values'] = ini_values_csv;
process.env['coverage'] = coverage_driver; process.env['coverage'] = coverage_driver;
process.env['tools'] = tools; process.env['tools'] = tools;
process.env['pecl'] = pecl;
} }
describe('Install', () => { describe('Install', () => {
it('Test install on windows', async () => { it('Test install on windows', async () => {
setEnv('7.0', 'win32', '', '', '', '', ''); setEnv('7.0', 'win32', '', '', '', '');
// @ts-ignore
let script: string = await install.run(); let script: string = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('pwsh script.ps1 7.0 ' + __dirname); expect(script).toContain('pwsh script.ps1 7.0 ' + __dirname);
setEnv('7.3', 'win32', '', '', '', '', ''); setEnv('7.3', 'win32', '', '', '', '');
// @ts-ignore
script = await install.run(); script = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('pwsh script.ps1 7.3 ' + __dirname); expect(script).toContain('pwsh script.ps1 7.3 ' + __dirname);
setEnv('7.3', 'win32', 'a, b', 'a=b', 'x', '', ''); setEnv('7.3', 'win32', 'a, b', 'a=b', 'x', '');
// @ts-ignore
script = await install.run(); script = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('install extensions'); expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini'); expect(script).toContain('edit php.ini');
@@ -113,25 +112,15 @@ describe('Install', () => {
}); });
it('Test install on linux', async () => { it('Test install on linux', async () => {
setEnv('7.3', 'linux', '', '', '', '', ''); setEnv('7.3', 'linux', '', '', '', '');
// @ts-ignore
let script: string = await install.run(); let script: string = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('bash script.sh 7.3 '); expect(script).toContain('bash script.sh 7.3 ');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit', 'true'); setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit');
// @ts-ignore
script = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
expect(script).toContain('bash script.sh 7.3');
expect(script).toContain('add_tool');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit', ''); script = '' + (await install.run());
// @ts-ignore
script = await install.run();
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('install extensions'); expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini'); expect(script).toContain('edit php.ini');
@@ -141,15 +130,15 @@ describe('Install', () => {
}); });
it('Test install on darwin', async () => { it('Test install on darwin', async () => {
setEnv('7.3', 'darwin', '', '', '', '', ''); setEnv('7.3', 'darwin', '', '', '', '');
// @ts-ignore
let script: string = await install.run(); let script: string = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('bash script.sh 7.3 ' + __dirname); expect(script).toContain('bash script.sh 7.3 ' + __dirname);
setEnv('7.3', 'darwin', 'a, b', 'a=b', 'x', '', ''); setEnv('7.3', 'darwin', 'a, b', 'a=b', 'x', '');
// @ts-ignore
script = await install.run(); script = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('install extensions'); expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini'); expect(script).toContain('edit php.ini');
@@ -158,21 +147,21 @@ describe('Install', () => {
}); });
it('Test malformed version inputs', async () => { it('Test malformed version inputs', async () => {
setEnv('7.4.1', 'darwin', '', '', '', '', ''); setEnv('7.4.1', 'darwin', '', '', '', '');
// @ts-ignore
let script: string = await install.run(); let script: string = '' + '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('bash script.sh 7.4 ' + __dirname); expect(script).toContain('bash script.sh 7.4 ' + __dirname);
setEnv(8.0, 'darwin', '', '', '', '', ''); setEnv(8.0, 'darwin', '', '', '', '');
// @ts-ignore
script = await install.run(); script = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('bash script.sh 8.0 ' + __dirname); expect(script).toContain('bash script.sh 8.0 ' + __dirname);
setEnv(8, 'darwin', '', '', '', '', ''); setEnv(8, 'darwin', '', '', '', '');
// @ts-ignore
script = await install.run(); script = '' + (await install.run());
expect(script).toContain('initial script'); expect(script).toContain('initial script');
expect(script).toContain('bash script.sh 8.0 ' + __dirname); expect(script).toContain('bash script.sh 8.0 ' + __dirname);
}); });
+7 -1
View File
@@ -391,7 +391,7 @@ describe('Tools tests', () => {
}); });
it('checking addTools on darwin', async () => { it('checking addTools on darwin', async () => {
const script: string = await tools.addTools( const script: string = await tools.addTools(
'blackfire, blackfire-player, flex, infection, phpcs, phpcbf, phpcpd, phpmd, psalm, phinx, vapor-cli, phive:1.2.3, cs2pr:1.2.3, composer-prefetcher:1.2.3, phpize, php-config, symfony, symfony:1.2.3, wp-cli', 'blackfire, blackfire-player, flex, infection, phan, phpcs, phpcbf, phpcpd, phpmd, psalm, phinx, vapor-cli, phan:2.7.2, phive:1.2.3, cs2pr:1.2.3, composer-prefetcher:1.2.3, phpize, php-config, symfony, symfony:1.2.3, wp-cli',
'7.4', '7.4',
'darwin' 'darwin'
); );
@@ -408,6 +408,9 @@ describe('Tools tests', () => {
expect(script).toContain( expect(script).toContain(
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection' 'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection'
); );
expect(script).toContain(
'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan'
);
expect(script).toContain( expect(script).toContain(
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs' 'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs'
); );
@@ -426,6 +429,9 @@ describe('Tools tests', () => {
expect(script).toContain('add_composertool vapor-cli vapor-cli laravel/'); expect(script).toContain('add_composertool vapor-cli vapor-cli laravel/');
expect(script).toContain('add_composertool flex flex symfony/'); expect(script).toContain('add_composertool flex flex symfony/');
expect(script).toContain('add_composertool phinx phinx robmorgan/'); expect(script).toContain('add_composertool phinx phinx robmorgan/');
expect(script).toContain(
'add_tool https://github.com/phan/phan/releases/download/2.7.2/phan.phar phan'
);
expect(script).toContain( expect(script).toContain(
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive' 'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
); );
+14 -4
View File
@@ -19,7 +19,13 @@ module.exports =
/******/ }; /******/ };
/******/ /******/
/******/ // Execute the module function /******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ var threw = true;
/******/ try {
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ threw = false;
/******/ } finally {
/******/ if(threw) delete installedModules[moduleId];
/******/ }
/******/ /******/
/******/ // Flag the module as loaded /******/ // Flag the module as loaded
/******/ module.l = true; /******/ module.l = true;
@@ -1981,6 +1987,10 @@ async function addTools(tools_csv, php_version, os_version) {
url = github + 'squizlabs/PHP_CodeSniffer/' + uri; url = github + 'squizlabs/PHP_CodeSniffer/' + uri;
script += await addArchive(tool, version, url, os_version); script += await addArchive(tool, version, url, os_version);
break; break;
case 'phan':
url = github + 'phan/phan/' + uri;
script += await addArchive(tool, version, url, os_version);
break;
case 'phive': case 'phive':
script += await addPhive(version, os_version); script += await addPhive(version, os_version);
break; break;
@@ -2664,7 +2674,7 @@ const utils = __importStar(__webpack_require__(163));
async function addExtensionDarwin(extension_csv, version, pipe) { async function addExtensionDarwin(extension_csv, version, pipe) {
const extensions = await utils.extensionArray(extension_csv); const extensions = await utils.extensionArray(extension_csv);
let add_script = '\n'; let add_script = '\n';
let remove_script = '\n'; let remove_script = '';
await utils.asyncForEach(extensions, async function (extension) { await utils.asyncForEach(extensions, async function (extension) {
const version_extension = version + extension; const version_extension = version + extension;
const [ext_name, ext_version] = extension.split('-'); const [ext_name, ext_version] = extension.split('-');
@@ -2771,7 +2781,7 @@ exports.addExtensionDarwin = addExtensionDarwin;
async function addExtensionWindows(extension_csv, version) { async function addExtensionWindows(extension_csv, version) {
const extensions = await utils.extensionArray(extension_csv); const extensions = await utils.extensionArray(extension_csv);
let add_script = '\n'; let add_script = '\n';
let remove_script = '\n'; let remove_script = '';
await utils.asyncForEach(extensions, async function (extension) { await utils.asyncForEach(extensions, async function (extension) {
const [ext_name, ext_version] = extension.split('-'); const [ext_name, ext_version] = extension.split('-');
const version_extension = version + extension; const version_extension = version + extension;
@@ -2853,7 +2863,7 @@ exports.addExtensionWindows = addExtensionWindows;
async function addExtensionLinux(extension_csv, version, pipe) { async function addExtensionLinux(extension_csv, version, pipe) {
const extensions = await utils.extensionArray(extension_csv); const extensions = await utils.extensionArray(extension_csv);
let add_script = '\n'; let add_script = '\n';
let remove_script = '\n'; let remove_script = '';
await utils.asyncForEach(extensions, async function (extension) { await utils.asyncForEach(extensions, async function (extension) {
const version_extension = version + extension; const version_extension = version + extension;
const [ext_name, ext_version] = extension.split('-'); const [ext_name, ext_version] = extension.split('-');
+91 -72
View File
@@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.2.0", "version": "2.2.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -364,15 +364,6 @@
"@babel/helper-plugin-utils": "^7.8.0" "@babel/helper-plugin-utils": "^7.8.0"
} }
}, },
"@babel/runtime": {
"version": "7.9.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz",
"integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"@babel/template": { "@babel/template": {
"version": "7.8.6", "version": "7.8.6",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz",
@@ -437,13 +428,14 @@
} }
}, },
"@istanbuljs/load-nyc-config": { "@istanbuljs/load-nyc-config": {
"version": "1.0.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
"integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"camelcase": "^5.3.1", "camelcase": "^5.3.1",
"find-up": "^4.1.0", "find-up": "^4.1.0",
"get-package-type": "^0.1.0",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"resolve-from": "^5.0.0" "resolve-from": "^5.0.0"
}, },
@@ -900,9 +892,9 @@
} }
}, },
"@sinonjs/commons": { "@sinonjs/commons": {
"version": "1.7.2", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.2.tgz", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.0.tgz",
"integrity": "sha512-+DUO6pnp3udV/v2VfUWgaY5BIE1IfT7lLfeDzPVeMT1XKkaAp9LgSI9x5RtrFQoZ9Oi0PgXQQHPaoKu7dCjVxw==", "integrity": "sha512-wEj54PfsZ5jGSwMX68G8ZXFawcSglQSXqCftWX3ec8MDUzQdHgcKvw97awHbY0efQEL5iKUOAmmVtoYgmrSG4Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"type-detect": "4.0.8" "type-detect": "4.0.8"
@@ -1005,9 +997,9 @@
} }
}, },
"@types/jest": { "@types/jest": {
"version": "25.2.2", "version": "25.2.3",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.2.2.tgz", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.2.3.tgz",
"integrity": "sha512-aRctFbG8Pb7DSLzUt/fEtL3q/GKb9mretFuYhRub2J0q6NhzBYbx9HTQzHrWgBNIxYOlxGNVe6Z54cpbUt+Few==", "integrity": "sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw==",
"dev": true, "dev": true,
"requires": { "requires": {
"jest-diff": "^25.2.1", "jest-diff": "^25.2.1",
@@ -1021,9 +1013,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "14.0.1", "version": "14.0.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.5.tgz",
"integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==", "integrity": "sha512-90hiq6/VqtQgX8Sp0EzeIsv3r+ellbGj4URKj5j30tLlZvRUpnAe9YbYnjl3pJM93GyXU0tghHhvXHq+5rnCKA==",
"dev": true "dev": true
}, },
"@types/normalize-package-data": { "@types/normalize-package-data": {
@@ -1039,9 +1031,9 @@
"dev": true "dev": true
}, },
"@types/prettier": { "@types/prettier": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.1.tgz",
"integrity": "sha512-/rM+sWiuOZ5dvuVzV37sUuklsbg+JPOP8d+nNFlo2ZtfpzPiPvh1/gc8liWOLBqe+sR+ZM7guPaIcTt6UZTo7Q==", "integrity": "sha512-boy4xPNEtiw6N3abRhBi/e7hNvy3Tt8E9ZRAQrwAGzoCGZS/1wjo9KY7JHhnfnEsG5wSjDbymCozUM9a3ea7OQ==",
"dev": true "dev": true
}, },
"@types/stack-utils": { "@types/stack-utils": {
@@ -1066,45 +1058,46 @@
"dev": true "dev": true
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "2.33.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.33.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.0.0.tgz",
"integrity": "sha512-QV6P32Btu1sCI/kTqjTNI/8OpCYyvlGjW5vD8MpTIg+HGE5S88HtT1G+880M4bXlvXj/NjsJJG0aGcVh0DdbeQ==", "integrity": "sha512-lcZ0M6jD4cqGccYOERKdMtg+VWpoq3NSnWVxpc/AwAy0zhkUYVioOUZmfNqiNH8/eBNGhCn6HXd6mKIGRgNc1Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/experimental-utils": "2.33.0", "@typescript-eslint/experimental-utils": "3.0.0",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0", "regexpp": "^3.0.0",
"semver": "^7.3.2",
"tsutils": "^3.17.1" "tsutils": "^3.17.1"
} }
}, },
"@typescript-eslint/experimental-utils": { "@typescript-eslint/experimental-utils": {
"version": "2.33.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.33.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz",
"integrity": "sha512-qzPM2AuxtMrRq78LwyZa8Qn6gcY8obkIrBs1ehqmQADwkYzTE1Pb4y2W+U3rE/iFkSWcWHG2LS6MJfj6SmHApg==", "integrity": "sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/json-schema": "^7.0.3", "@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.33.0", "@typescript-eslint/typescript-estree": "3.0.0",
"eslint-scope": "^5.0.0", "eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0" "eslint-utils": "^2.0.0"
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "2.33.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.33.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.0.0.tgz",
"integrity": "sha512-AUtmwUUhJoH6yrtxZMHbRUEMsC2G6z5NSxg9KsROOGqNXasM71I8P2NihtumlWTUCRld70vqIZ6Pm4E5PAziEA==", "integrity": "sha512-8RRCA9KLxoFNO0mQlrLZA0reGPd/MsobxZS/yPFj+0/XgMdS8+mO8mF3BDj2ZYQj03rkayhSJtF1HAohQ3iylw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/eslint-visitor-keys": "^1.0.0", "@types/eslint-visitor-keys": "^1.0.0",
"@typescript-eslint/experimental-utils": "2.33.0", "@typescript-eslint/experimental-utils": "3.0.0",
"@typescript-eslint/typescript-estree": "2.33.0", "@typescript-eslint/typescript-estree": "3.0.0",
"eslint-visitor-keys": "^1.1.0" "eslint-visitor-keys": "^1.1.0"
} }
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "2.33.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.33.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz",
"integrity": "sha512-d8rY6/yUxb0+mEwTShCQF2zYQdLlqihukNfG9IUlLYz5y1CH6G/9XYbrxQLq3Z14RNvkCC6oe+OcFlyUpwUbkg==", "integrity": "sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg==",
"dev": true, "dev": true,
"requires": { "requires": {
"debug": "^4.1.1", "debug": "^4.1.1",
@@ -1117,9 +1110,9 @@
} }
}, },
"@zeit/ncc": { "@zeit/ncc": {
"version": "0.22.1", "version": "0.22.2",
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.1.tgz", "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.2.tgz",
"integrity": "sha512-Qq3bMuonkcnV/96jhy9SQYdh39NXHxNMJ1O31ZFzWG9n52fR2DLtgrNzhj/ahlEjnBziMLGVWDbaS9sf03/fEw==", "integrity": "sha512-LGW5RPIwulh+fyKiMTgbIEbdc/hdf/4+U5B1WbT/We0jweHoywDbk9hi+3hNjSzQNShGumP72zgc6PHEUG5syg==",
"dev": true "dev": true
}, },
"abab": { "abab": {
@@ -2256,12 +2249,41 @@
} }
}, },
"eslint-plugin-jest": { "eslint-plugin-jest": {
"version": "23.11.0", "version": "23.13.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.11.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.13.1.tgz",
"integrity": "sha512-qedvh6mcMgoLFHjITtG40yKOCu5Fa1GMYesDOclU30ZvtVkf+DaH0fnCn1ysOX/QMdk2SGhQvxvYLowcLaM0GA==", "integrity": "sha512-TRLJH6M6EDvGocD98a7yVThrAOCK9WJfo9phuUb0MJptcrOYZeCKzC9aOzZCD93sxXCsiJVZywaTHdI/mAi0FQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/experimental-utils": "^2.5.0" "@typescript-eslint/experimental-utils": "^2.5.0"
},
"dependencies": {
"@typescript-eslint/experimental-utils": {
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz",
"integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.34.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz",
"integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==",
"dev": true,
"requires": {
"debug": "^4.1.1",
"eslint-visitor-keys": "^1.1.0",
"glob": "^7.1.6",
"is-glob": "^4.0.1",
"lodash": "^4.17.15",
"semver": "^7.3.2",
"tsutils": "^3.17.1"
}
}
} }
}, },
"eslint-plugin-prettier": { "eslint-plugin-prettier": {
@@ -2803,6 +2825,12 @@
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true "dev": true
}, },
"get-package-type": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz",
"integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==",
"dev": true
},
"get-stdin": { "get-stdin": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
@@ -5603,12 +5631,6 @@
"read-pkg": "^2.0.0" "read-pkg": "^2.0.0"
} }
}, },
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
},
"regex-not": { "regex-not": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
@@ -6684,9 +6706,9 @@
} }
}, },
"ts-jest": { "ts-jest": {
"version": "25.5.1", "version": "26.0.0",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-25.5.1.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.0.0.tgz",
"integrity": "sha512-kHEUlZMK8fn8vkxDjwbHlxXRB9dHYpyzqKIGDNxbzs+Rz+ssNDSDNusEK8Fk/sDd4xE6iKoQLfFkFVaskmTJyw==", "integrity": "sha512-eBpWH65mGgzobuw7UZy+uPP9lwu+tPp60o324ASRX4Ijg8UC5dl2zcge4kkmqr2Zeuk9FwIjvCTOPuNMEyGWWw==",
"dev": true, "dev": true,
"requires": { "requires": {
"bs-logger": "0.x", "bs-logger": "0.x",
@@ -6696,15 +6718,15 @@
"lodash.memoize": "4.x", "lodash.memoize": "4.x",
"make-error": "1.x", "make-error": "1.x",
"micromatch": "4.x", "micromatch": "4.x",
"mkdirp": "0.x", "mkdirp": "1.x",
"semver": "6.x", "semver": "7.x",
"yargs-parser": "18.x" "yargs-parser": "18.x"
}, },
"dependencies": { "dependencies": {
"semver": { "mkdirp": {
"version": "6.3.0", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true "dev": true
} }
} }
@@ -6770,9 +6792,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "3.9.2", "version": "3.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz",
"integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==",
"dev": true "dev": true
}, },
"union-value": { "union-value": {
@@ -7058,13 +7080,10 @@
"dev": true "dev": true
}, },
"yaml": { "yaml": {
"version": "1.9.2", "version": "1.10.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz",
"integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==", "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==",
"dev": true, "dev": true
"requires": {
"@babel/runtime": "^7.9.2"
}
}, },
"yargs": { "yargs": {
"version": "15.3.1", "version": "15.3.1",
+9 -9
View File
@@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.2.0", "version": "2.2.2",
"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",
@@ -30,22 +30,22 @@
"fs": "0.0.1-security" "fs": "0.0.1-security"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^25.2.1", "@types/jest": "^25.2.3",
"@types/node": "^14.0.1", "@types/node": "^14.0.5",
"@typescript-eslint/eslint-plugin": "^2.33.0", "@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^2.33.0", "@typescript-eslint/parser": "^3.0.0",
"@zeit/ncc": "^0.22.1", "@zeit/ncc": "^0.22.2",
"eslint": "^7.0.0", "eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0", "eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2", "eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.11.0", "eslint-plugin-jest": "^23.13.1",
"eslint-plugin-prettier": "^3.1.3", "eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5", "husky": "^4.2.5",
"jest": "^26.0.1", "jest": "^26.0.1",
"jest-circus": "^26.0.1", "jest-circus": "^26.0.1",
"prettier": "^2.0.5", "prettier": "^2.0.5",
"ts-jest": "^25.5.1", "ts-jest": "^26.0.0",
"typescript": "^3.9.2" "typescript": "^3.9.3"
}, },
"husky": { "husky": {
"skipCI": true, "skipCI": true,
+3 -3
View File
@@ -15,7 +15,7 @@ export async function addExtensionDarwin(
): Promise<string> { ): Promise<string> {
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 = '';
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('-');
@@ -127,7 +127,7 @@ export async function addExtensionWindows(
): Promise<string> { ): Promise<string> {
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 = '';
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;
@@ -219,7 +219,7 @@ export async function addExtensionLinux(
): Promise<string> { ): Promise<string> {
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 = '';
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('-');
+3
View File
@@ -118,6 +118,9 @@ add_tool() {
if [ -n "$COMPOSER_TOKEN" ]; then if [ -n "$COMPOSER_TOKEN" ]; then
composer -q global config github-oauth.github.com "$COMPOSER_TOKEN" composer -q global config github-oauth.github.com "$COMPOSER_TOKEN"
fi fi
elif [ "$tool" = "phan" ]; then
add_extension fileinfo "sudo pecl install -f fileinfo" extension >/dev/null 2>&1
add_extension ast "sudo pecl install -f ast" extension >/dev/null 2>&1
elif [ "$tool" = "phive" ]; then elif [ "$tool" = "phive" ]; then
add_extension curl "sudo pecl install -f curl" extension >/dev/null 2>&1 add_extension curl "sudo pecl install -f curl" extension >/dev/null 2>&1
add_extension mbstring "sudo pecl install -f mbstring" extension >/dev/null 2>&1 add_extension mbstring "sudo pecl install -f mbstring" extension >/dev/null 2>&1
+4 -1
View File
@@ -219,6 +219,9 @@ add_tool() {
fi fi
elif [ "$tool" = "cs2pr" ]; then elif [ "$tool" = "cs2pr" ]; then
sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path" sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path"
elif [ "$tool" = "phan" ]; then
add_extension fileinfo "$apt_install php$version-fileinfo" extension >/dev/null 2>&1
add_extension ast "$apt_install php-ast" extension >/dev/null 2>&1
elif [ "$tool" = "phive" ]; then elif [ "$tool" = "phive" ]; then
add_extension curl "$apt_install php$version-curl" extension >/dev/null 2>&1 add_extension curl "$apt_install php$version-curl" extension >/dev/null 2>&1
add_extension mbstring "$apt_install php$version-mbstring" extension >/dev/null 2>&1 add_extension mbstring "$apt_install php$version-mbstring" extension >/dev/null 2>&1
@@ -400,6 +403,6 @@ ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||") scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
pecl_file="$scan_dir"/99-pecl.ini pecl_file="$scan_dir"/99-pecl.ini
sudo touch "$pecl_file" >/dev/null 2>&1 echo '' | sudo tee "$pecl_file" >/dev/null 2>&1
sudo chmod 777 "$ini_file" "$pecl_file" "$tool_path_dir" sudo chmod 777 "$ini_file" "$pecl_file" "$tool_path_dir"
add_log "$tick" "PHP" "$status PHP $semver" add_log "$tick" "PHP" "$status PHP $semver"
+4 -1
View File
@@ -165,7 +165,10 @@ Function Add-Tool() {
Add-Content -Path $current_profile -Value "New-Alias $tool $php_dir\$tool.bat" >$null 2>&1 Add-Content -Path $current_profile -Value "New-Alias $tool $php_dir\$tool.bat" >$null 2>&1
} catch { } } catch { }
} }
if($tool -eq "phive") { if($tool -eq "phan") {
Add-Extension fileinfo >$null 2>&1
Add-Extension ast >$null 2>&1
} elseif($tool -eq "phive") {
Add-Extension xml >$null 2>&1 Add-Extension xml >$null 2>&1
} elseif($tool -eq "cs2pr") { } elseif($tool -eq "cs2pr") {
(Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr (Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr
+4
View File
@@ -463,6 +463,10 @@ export async function addTools(
url = github + 'squizlabs/PHP_CodeSniffer/' + uri; url = github + 'squizlabs/PHP_CodeSniffer/' + uri;
script += await addArchive(tool, version, url, os_version); script += await addArchive(tool, version, url, os_version);
break; break;
case 'phan':
url = github + 'phan/phan/' + uri;
script += await addArchive(tool, version, url, os_version);
break;
case 'phive': case 'phive':
script += await addPhive(version, os_version); script += await addPhive(version, os_version);
break; break;