From db03758c663995b18621fffefef36b116df9e75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 19 Jul 2020 13:10:14 +0200 Subject: [PATCH] Enhancement: Add composer-unused/composer-unused as tool --- README.md | 2 +- __tests__/tools.test.ts | 5 ++++- dist/index.js | 5 +++++ src/tools.ts | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d5756c36..a1266843 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ with: These tools can be setup globally using the `tools` input. -`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-normalize`, `composer-prefetcher`, `composer-require-checker`,`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` +`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-normalize`, `composer-prefetcher`, `composer-require-checker`, `composer-unused`, `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 uses: shivammathur/setup-php@v2 diff --git a/__tests__/tools.test.ts b/__tests__/tools.test.ts index bb6cb722..aa261a46 100644 --- a/__tests__/tools.test.ts +++ b/__tests__/tools.test.ts @@ -447,7 +447,7 @@ describe('Tools tests', () => { }); it('checking addTools on darwin', async () => { const script: string = await tools.addTools( - 'blackfire, blackfire-player, composer-normalize, composer-require-checker, 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', + 'blackfire, blackfire-player, composer-normalize, composer-require-checker, composer-unused, 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', 'darwin' ); @@ -464,6 +464,9 @@ describe('Tools tests', () => { expect(script).toContain( 'add_tool https://github.com/maglnet/ComposerRequireChecker/releases/latest/download/composer-require-checker.phar composer-require-checker' ); + expect(script).toContain( + 'add_tool https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar composer-unused' + ); expect(script).toContain( 'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr' ); diff --git a/dist/index.js b/dist/index.js index b8a24625..e1f020ce 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2306,6 +2306,11 @@ async function addTools(tools_csv, php_version, os_version) { url = github + 'maglnet/ComposerRequireChecker/' + uri; script += await addArchive(tool, version, url, os_version); break; + case 'composer-unused': + uri = await getUri(tool, '.phar', version, 'releases', '', 'download'); + url = github + 'composer-unused/composer-unused/' + uri; + script += await addArchive(tool, version, url, os_version); + break; case 'cs2pr': uri = await getUri(tool, '', version, 'releases', '', 'download'); url = github + 'staabm/annotate-pull-request-from-checkstyle/' + uri; diff --git a/src/tools.ts b/src/tools.ts index 9ca0bc18..53670269 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -487,6 +487,11 @@ export async function addTools( url = github + 'maglnet/ComposerRequireChecker/' + uri; script += await addArchive(tool, version, url, os_version); break; + case 'composer-unused': + uri = await getUri(tool, '.phar', version, 'releases', '', 'download'); + url = github + 'composer-unused/composer-unused/' + uri; + script += await addArchive(tool, version, url, os_version); + break; case 'cs2pr': uri = await getUri(tool, '', version, 'releases', '', 'download'); url = github + 'staabm/annotate-pull-request-from-checkstyle/' + uri;