diff --git a/README.md b/README.md index d84c2e19..9ccf604c 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ Both `GitHub-hosted` runners and `self-hosted` runners are supported on the foll These tools can be setup globally using the `tools` input. -`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-normalize`, `composer-prefetcher`, `composer-require-checker`, `composer-unused`, `cs2pr`, `deployer`, `flex`, `grpc_php_plugin`, `infection`, `pecl`, `phan`, `phing`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `protoc`, `psalm`, `symfony`, `vapor-cli` +`behat`, `blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-normalize`, `composer-prefetcher`, `composer-require-checker`, `composer-unused`, `cs2pr`, `deployer`, `flex`, `grpc_php_plugin`, `infection`, `pecl`, `phan`, `phing`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpspec`, `phpstan`, `phpunit`, `prestissimo`, `protoc`, `psalm`, `symfony`, `vapor-cli` ```yaml - name: Setup PHP with tools diff --git a/__tests__/tools.test.ts b/__tests__/tools.test.ts index d9224892..d8009e64 100644 --- a/__tests__/tools.test.ts +++ b/__tests__/tools.test.ts @@ -277,14 +277,19 @@ describe('Tools tests', () => { it('checking getCleanedToolsList', async () => { const tools_list: string[] = await tools.getCleanedToolsList( - 'tool, composer:1.2.3, robmorgan/phinx, hirak/prestissimo, narrowspark/automatic-composer-prefetcher' + 'tool, composer:1.2.3, behat/behat, icanhazstring/composer-unused, laravel/vapor-cli, robmorgan/phinx, hirak/prestissimo, narrowspark/automatic-composer-prefetcher, phpspec/phpspec, symfony/flex' ); expect(tools_list).toStrictEqual([ 'composer', 'tool', + 'behat', + 'composer-unused', + 'vapor-cli', 'phinx', 'prestissimo', - 'composer-prefetcher' + 'composer-prefetcher', + 'phpspec', + 'flex' ]); }); @@ -424,6 +429,7 @@ describe('Tools tests', () => { }); it('checking addTools on darwin', async () => { const listOfTools = [ + 'behat', 'blackfire', 'blackfire-player', 'composer-normalize', @@ -445,6 +451,7 @@ describe('Tools tests', () => { 'phpcs', 'phpize', 'phpmd', + 'phpspec', 'protoc:v1.2.3', 'psalm', 'symfony', @@ -501,6 +508,8 @@ describe('Tools tests', () => { ); expect(script).toContain('add_grpc_php_plugin 1.2.3'); expect(script).toContain('add_protoc 1.2.3'); + expect(script).toContain('add_composertool behat behat behat/'); + expect(script).toContain('add_composertool phpspec phpspec phpspec/'); 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/'); diff --git a/dist/index.js b/dist/index.js index 2d9ed59c..cf37cf20 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2053,7 +2053,7 @@ async function getCleanedToolsList(tools_csv) { .map(function (extension) { return extension .trim() - .replace(/-agent|hirak\/|icanhazstring\/|laravel\/|narrowspark\/automatic-|overtrue\/|robmorgan\/|symfony\//, ''); + .replace(/-agent|behat\/|hirak\/|icanhazstring\/|laravel\/|narrowspark\/automatic-|overtrue\/|phpspec\/|robmorgan\/|symfony\//, ''); }) .filter(Boolean); return [...new Set(tools_list)]; @@ -2127,6 +2127,10 @@ async function addTools(tools_csv, php_version, os_version) { case 'protoc': script += await utils.customPackage(tool, 'tools', version, os_version); break; + case 'behat': + case 'phpspec': + script += await addPackage(tool, release, tool + '/', os_version); + break; case 'blackfire-player': url = await getPharUrl('https://get.blackfire.io', tool, 'v', version); script += await addArchive(tool, url, os_version, '"-V"'); diff --git a/src/tools.ts b/src/tools.ts index 0400eae9..3a9cbbb3 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -334,7 +334,7 @@ export async function getCleanedToolsList( return extension .trim() .replace( - /-agent|hirak\/|icanhazstring\/|laravel\/|narrowspark\/automatic-|overtrue\/|robmorgan\/|symfony\//, + /-agent|behat\/|hirak\/|icanhazstring\/|laravel\/|narrowspark\/automatic-|overtrue\/|phpspec\/|robmorgan\/|symfony\//, '' ); }) @@ -445,6 +445,10 @@ export async function addTools( case 'protoc': script += await utils.customPackage(tool, 'tools', version, os_version); break; + case 'behat': + case 'phpspec': + script += await addPackage(tool, release, tool + '/', os_version); + break; case 'blackfire-player': url = await getPharUrl('https://get.blackfire.io', tool, 'v', version); script += await addArchive(tool, url, os_version, '"-V"');