Skip to content

Commit

Permalink
Refactor tools
Browse files Browse the repository at this point in the history
Improve support for tool aliases
  • Loading branch information
shivammathur committed Feb 20, 2021
1 parent cff0bde commit 739ccac
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 7,760 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ The version can be a branch name or tag as supported by `git clone -b <name>`. T

These tools can be setup globally using the `tools` input. It accepts a string in csv-format.

`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`, `php-config`, `php-cs-fixer`, `phpcbf`, `phpcpd`, `phpcs`, `phpize`, `phplint`, `phpmd`, `phpspec`, `phpstan`, `phpunit`, `prestissimo`, `protoc`, `psalm`, `symfony`, `symfony-cli`, `vapor-cli`, `wp-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`, `php-config`, `php-cs-fixer`, `phpcbf`, `phpcpd`, `phpcs`, `phpize`, `phplint`, `phpmd`, `phpspec`, `phpstan`, `phpunit`, `prestissimo`, `protoc`, `psalm`, `symfony` or `symfony-cli`, `vapor` or `vapor-cli`, `wp` or `wp-cli`

```yaml
- name: Setup PHP with tools
Expand Down
4 changes: 2 additions & 2 deletions __tests__/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ describe('Tools tests', () => {
'phpspec',
'protoc:v1.2.3',
'psalm',
'symfony',
'symfony-cli',
'symfony:1.2.3',
'vapor-cli',
'wp-cli'
Expand Down Expand Up @@ -504,7 +504,7 @@ describe('Tools tests', () => {
'phpize',
'phpmd',
'symfony',
'wp-cli'
'wp'
];

const script: string = await tools.addTools(
Expand Down
10 changes: 5 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2106,16 +2106,14 @@ async function addTools(tools_csv, php_version, os_version) {
script += await utils.customPackage(tool, 'tools', version, os_version);
break;
case 'behat':
case 'codeception':
case 'phpspec':
script += await addPackage(tool, release, tool + '/', os_version);
break;
case 'blackfire-player':
url = await getBlackfirePlayerUrl(version, php_version);
script += await addArchive(tool, url, os_version, '"-V"');
break;
case 'codeception':
script += await addPackage(tool, release, 'codeception/', os_version);
break;
case 'composer':
url = await getComposerUrl(version);
script += await addArchive('composer', url, os_version, version);
Expand Down Expand Up @@ -2213,11 +2211,13 @@ async function addTools(tools_csv, php_version, os_version) {
script += await addArchive('symfony', url, os_version, 'version');
break;
case 'vapor-cli':
script += await addPackage(tool, release, 'laravel/', os_version);
case 'vapor':
script += await addPackage('vapor-cli', release, 'laravel/', os_version);
break;
case 'wp':
case 'wp-cli':
url = github + (await getWpCliUrl(version));
script += await addArchive(tool, url, os_version, '"--version"');
script += await addArchive('wp-cli', url, os_version, '"--version"');
break;
default:
script += await utils.addLog('$cross', tool, 'Tool ' + tool + ' is not supported', os_version);
Expand Down
Loading

0 comments on commit 739ccac

Please sign in to comment.