feat : narrowspark/automatic-composer-prefetcher as a alternative to prestissimo

This commit is contained in:
Daniel Bannert 2020-01-04 07:22:15 +01:00 committed by prisis
parent 7b8bf7af6a
commit 5b00f068f3
5 changed files with 58 additions and 12 deletions

View File

@ -72,7 +72,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
The latest version of the following tools can be setup globally using the `tools` input. The latest version of the following tools can be setup globally using the `tools` input.
`composer`, `codeception`, `deployer`, `pecl`, `phinx`, `phpcbf`, `phpcpd`, `php-cs-fixer`, `phpcs`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm` `composer`, `codeception`, `deployer`, `pecl`, `phinx`, `phpcbf`, `phpcpd`, `php-cs-fixer`, `phpcs`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `composer-prefetcher`, `psalm`
```yaml ```yaml
uses: shivammathur/setup-php@v1 uses: shivammathur/setup-php@v1

View File

@ -106,5 +106,13 @@ describe('Tools tests', () => {
'Add-Content -Path $PsHome\\profile.ps1 -Value "New-Alias phinx $composer_dir\\vendor\\bin\\phinx.bat"' 'Add-Content -Path $PsHome\\profile.ps1 -Value "New-Alias phinx $composer_dir\\vendor\\bin\\phinx.bat"'
); );
expect(script).toContain('Tool does_not_exit is not supported'); expect(script).toContain('Tool does_not_exit is not supported');
script = await tools.addTools('phpstan, composer-prefetcher', 'darwin');
expect(script).toContain(
'add_tool https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar phpstan'
);
expect(script).toContain(
'composer global require narrowspark/automatic-composer-prefetcher'
);
}); });
}); });

7
dist/index.js vendored
View File

@ -1715,6 +1715,13 @@ function addTools(tools_csv, os_version) {
'\n' + '\n' +
(yield utils.addLog('$tick', 'hirak/prestissimo', 'Added', os_version)); (yield utils.addLog('$tick', 'hirak/prestissimo', 'Added', os_version));
break; break;
case 'composer-prefetcher':
script +=
'composer global require narrowspark/automatic-composer-prefetcher' +
(yield utils.suppressOutput(os_version)) +
'\n' +
(yield utils.addLog('$tick', 'narrowspark/automatic-composer-prefetcher', 'Added', os_version));
break;
case 'pecl': case 'pecl':
script += yield getPECLCommand(os_version); script += yield getPECLCommand(os_version);
break; break;

41
package-lock.json generated
View File

@ -2267,7 +2267,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -2288,12 +2289,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -2308,17 +2311,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -2435,7 +2441,8 @@
"inherits": { "inherits": {
"version": "2.0.4", "version": "2.0.4",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -2447,6 +2454,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -2461,6 +2469,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -2468,12 +2477,14 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -2492,6 +2503,7 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -2581,7 +2593,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -2593,6 +2606,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -2678,7 +2692,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -2714,6 +2729,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -2733,6 +2749,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -2776,12 +2793,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },

View File

@ -179,6 +179,18 @@ export async function addTools(
os_version os_version
)); ));
break; break;
case 'composer-prefetcher':
script +=
'composer global require narrowspark/automatic-composer-prefetcher' +
(await utils.suppressOutput(os_version)) +
'\n' +
(await utils.addLog(
'$tick',
'narrowspark/automatic-composer-prefetcher',
'Added',
os_version
));
break;
case 'pecl': case 'pecl':
script += await getPECLCommand(os_version); script += await getPECLCommand(os_version);
break; break;