mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Add support for behat and phpspec
This commit is contained in:
parent
9e663851ce
commit
b8f0b066dc
@ -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
|
||||
|
@ -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/');
|
||||
|
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -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"');
|
||||
|
@ -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"');
|
||||
|
Loading…
Reference in New Issue
Block a user