mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Add support for vapor-cli and infection tools
This commit is contained in:
parent
cf0fdf35f2
commit
f5863fd356
@ -391,7 +391,7 @@ describe('Tools tests', () => {
|
||||
});
|
||||
it('checking addTools on darwin', async () => {
|
||||
const script: string = await tools.addTools(
|
||||
'blackfire, blackfire-player, flex, phpcs, phpcbf, phpcpd, phpmd, psalm, phinx, 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, 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',
|
||||
'7.4',
|
||||
'darwin'
|
||||
);
|
||||
@ -405,6 +405,9 @@ describe('Tools tests', () => {
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr'
|
||||
);
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection'
|
||||
);
|
||||
expect(script).toContain(
|
||||
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs'
|
||||
);
|
||||
@ -420,6 +423,7 @@ describe('Tools tests', () => {
|
||||
expect(script).toContain(
|
||||
'https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm'
|
||||
);
|
||||
expect(script).toContain('add_composertool vapor-cli vapor-cli laravel/');
|
||||
expect(script).toContain('add_composertool flex flex symfony/');
|
||||
expect(script).toContain('add_composertool phinx phinx robmorgan/');
|
||||
expect(script).toContain(
|
||||
|
9
dist/index.js
vendored
9
dist/index.js
vendored
@ -1827,7 +1827,7 @@ async function getCleanedToolsList(tools_csv) {
|
||||
.map(function (extension) {
|
||||
return extension
|
||||
.trim()
|
||||
.replace(/symfony\/|robmorgan\/|hirak\/|narrowspark\/automatic-/, '');
|
||||
.replace(/symfony\/|laravel\/|robmorgan\/|hirak\/|narrowspark\/automatic-/, '');
|
||||
})
|
||||
.filter(Boolean);
|
||||
return [...new Set(tools_list)];
|
||||
@ -1911,6 +1911,10 @@ async function addTools(tools_csv, php_version, os_version) {
|
||||
url = github + 'staabm/annotate-pull-request-from-checkstyle/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'infection':
|
||||
url = github + 'infection/infection/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'php-cs-fixer':
|
||||
uri = await getUri(tool, '.phar', version, 'releases', 'v', 'download');
|
||||
url = github + 'FriendsOfPHP/PHP-CS-Fixer/' + uri;
|
||||
@ -1967,6 +1971,9 @@ async function addTools(tools_csv, php_version, os_version) {
|
||||
case 'prestissimo':
|
||||
script += await addPackage(tool, release, 'hirak/', os_version);
|
||||
break;
|
||||
case 'vapor-cli':
|
||||
script += await addPackage(tool, release, 'laravel/', os_version);
|
||||
break;
|
||||
case 'composer-prefetcher':
|
||||
script += await addPackage(tool, release, 'narrowspark/automatic-', os_version);
|
||||
break;
|
||||
|
@ -159,8 +159,6 @@ Function Add-Tool() {
|
||||
} catch { }
|
||||
}
|
||||
if($tool -eq "phive") {
|
||||
Add-Extension curl >$null 2>&1
|
||||
Add-Extension mbstring >$null 2>&1
|
||||
Add-Extension xml >$null 2>&1
|
||||
} elseif($tool -eq "cs2pr") {
|
||||
(Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr
|
||||
|
12
src/tools.ts
12
src/tools.ts
@ -327,7 +327,10 @@ export async function getCleanedToolsList(
|
||||
.map(function(extension: string) {
|
||||
return extension
|
||||
.trim()
|
||||
.replace(/symfony\/|robmorgan\/|hirak\/|narrowspark\/automatic-/, '');
|
||||
.replace(
|
||||
/symfony\/|laravel\/|robmorgan\/|hirak\/|narrowspark\/automatic-/,
|
||||
''
|
||||
);
|
||||
})
|
||||
.filter(Boolean);
|
||||
return [...new Set(tools_list)];
|
||||
@ -449,6 +452,10 @@ export async function addTools(
|
||||
url = github + 'staabm/annotate-pull-request-from-checkstyle/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'infection':
|
||||
url = github + 'infection/infection/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'php-cs-fixer':
|
||||
uri = await getUri(tool, '.phar', version, 'releases', 'v', 'download');
|
||||
url = github + 'FriendsOfPHP/PHP-CS-Fixer/' + uri;
|
||||
@ -505,6 +512,9 @@ export async function addTools(
|
||||
case 'prestissimo':
|
||||
script += await addPackage(tool, release, 'hirak/', os_version);
|
||||
break;
|
||||
case 'vapor-cli':
|
||||
script += await addPackage(tool, release, 'laravel/', os_version);
|
||||
break;
|
||||
case 'composer-prefetcher':
|
||||
script += await addPackage(
|
||||
tool,
|
||||
|
Loading…
Reference in New Issue
Block a user