mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 03:41:06 +07:00
Improve support for blackfire-player
This commit is contained in:
parent
52eb86c60c
commit
6db1a06425
@ -265,8 +265,9 @@ describe('Tools tests', () => {
|
||||
|
||||
it.each`
|
||||
version | php_version | url
|
||||
${'latest'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player.phar'}
|
||||
${'latest'} | ${'8.1'} | ${'https://get.blackfire.io/blackfire-player.phar'}
|
||||
${'1.2.3'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.2.3.phar'}
|
||||
${'latest'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.22.0.phar'}
|
||||
${'latest'} | ${'5.5'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||
${'latest'} | ${'7.0'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||
`(
|
||||
@ -376,7 +377,7 @@ describe('Tools tests', () => {
|
||||
[
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_blackfire',
|
||||
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"',
|
||||
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
|
||||
'add_tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
||||
'add_composertool flex flex symfony/ global',
|
||||
@ -417,7 +418,7 @@ describe('Tools tests', () => {
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_composertool behat behat behat/ scoped',
|
||||
'add_blackfire',
|
||||
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"',
|
||||
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
|
||||
'add_tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||
'add_tool https://github.com/ergebnis/composer-normalize/releases/latest/download/composer-normalize.phar composer-normalize "-V"',
|
||||
'add_composertool composer-require-checker composer-require-checker maglnet/ scoped',
|
||||
|
10
dist/index.js
vendored
10
dist/index.js
vendored
@ -759,9 +759,13 @@ async function addPackage(data) {
|
||||
}
|
||||
exports.addPackage = addPackage;
|
||||
async function addBlackfirePlayer(data) {
|
||||
if (/5\.[5-6]|7\.0/.test(data['php_version']) &&
|
||||
data['version'] == 'latest') {
|
||||
data['version'] = '1.9.3';
|
||||
if (data['version'] == 'latest') {
|
||||
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
||||
data['version'] = '1.9.3';
|
||||
}
|
||||
else if (/7\.[1-4]|8\.0/.test(data['php_version'])) {
|
||||
data['version'] = '1.22.0';
|
||||
}
|
||||
}
|
||||
data['url'] = await getPharUrl(data);
|
||||
return addArchive(data);
|
||||
|
11
src/tools.ts
11
src/tools.ts
@ -218,11 +218,12 @@ export async function addPackage(data: RS): Promise<string> {
|
||||
* @param data
|
||||
*/
|
||||
export async function addBlackfirePlayer(data: RS): Promise<string> {
|
||||
if (
|
||||
/5\.[5-6]|7\.0/.test(data['php_version']) &&
|
||||
data['version'] == 'latest'
|
||||
) {
|
||||
data['version'] = '1.9.3';
|
||||
if (data['version'] == 'latest') {
|
||||
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
||||
data['version'] = '1.9.3';
|
||||
} else if (/7\.[1-4]|8\.0/.test(data['php_version'])) {
|
||||
data['version'] = '1.22.0';
|
||||
}
|
||||
}
|
||||
data['url'] = await getPharUrl(data);
|
||||
return addArchive(data);
|
||||
|
Loading…
Reference in New Issue
Block a user