mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix blackfire-player on Linux and macOS
Drop support for blackfire-player on Windows
This commit is contained in:
parent
0de5aa9140
commit
7fdd3ece87
@ -281,16 +281,18 @@ describe('Tools tests', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
version | php_version | url
|
os | version | php_version | url
|
||||||
${'latest'} | ${'8.1'} | ${'https://get.blackfire.io/blackfire-player.phar'}
|
${'linux'} | ${'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'}
|
${'linux'} | ${'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'}
|
${'linux'} | ${'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'}
|
${'linux'} | ${'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'}
|
${'linux'} | ${'latest'} | ${'7.0'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||||
|
${'win32'} | ${'latest'} | ${'7.0'} | ${'blackfire-player is not a windows tool'}
|
||||||
`(
|
`(
|
||||||
'checking addBlackfirePlayer: $version, $php_version',
|
'checking addBlackfirePlayer: $os, $version, $php_version',
|
||||||
async ({version, php_version, url}) => {
|
async ({os, version, php_version, url}) => {
|
||||||
const data = getData({
|
const data = getData({
|
||||||
|
os: os,
|
||||||
tool: 'blackfire-player',
|
tool: 'blackfire-player',
|
||||||
domain: 'https://get.blackfire.io',
|
domain: 'https://get.blackfire.io',
|
||||||
version_prefix: 'v',
|
version_prefix: 'v',
|
||||||
@ -480,7 +482,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-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-Blackfire',
|
||||||
'Add-Tool https://get.blackfire.io/blackfire-player-v1.2.3.phar blackfire-player "-V"',
|
'blackfire-player is not a windows tool',
|
||||||
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
||||||
'Add-Tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
'Add-Tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||||
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
||||||
|
23
dist/index.js
vendored
23
dist/index.js
vendored
@ -826,16 +826,21 @@ async function addPackage(data) {
|
|||||||
}
|
}
|
||||||
exports.addPackage = addPackage;
|
exports.addPackage = addPackage;
|
||||||
async function addBlackfirePlayer(data) {
|
async function addBlackfirePlayer(data) {
|
||||||
if (data['version'] == 'latest') {
|
switch (data['os']) {
|
||||||
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
case 'win32':
|
||||||
data['version'] = '1.9.3';
|
return await utils.addLog('$cross', data['tool'], data['tool'] + ' is not a windows tool', 'win32');
|
||||||
}
|
default:
|
||||||
else if (/7\.[1-4]|8\.0/.test(data['php_version'])) {
|
if (data['version'] == 'latest') {
|
||||||
data['version'] = '1.22.0';
|
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);
|
||||||
}
|
}
|
||||||
data['url'] = await getPharUrl(data);
|
|
||||||
return addArchive(data);
|
|
||||||
}
|
}
|
||||||
exports.addBlackfirePlayer = addBlackfirePlayer;
|
exports.addBlackfirePlayer = addBlackfirePlayer;
|
||||||
async function addCastor(data) {
|
async function addCastor(data) {
|
||||||
|
@ -72,7 +72,9 @@ set_composer_auth() {
|
|||||||
add_tools_helper() {
|
add_tools_helper() {
|
||||||
tool=$1
|
tool=$1
|
||||||
extensions=()
|
extensions=()
|
||||||
if [ "$tool" = "codeception" ]; then
|
if [ "$tool" = "blackfire-player" ]; then
|
||||||
|
extensions+=(uuid)
|
||||||
|
elif [ "$tool" = "codeception" ]; then
|
||||||
extensions+=(json mbstring)
|
extensions+=(json mbstring)
|
||||||
sudo ln -s "$scoped_dir"/vendor/bin/codecept "$scoped_dir"/vendor/bin/codeception
|
sudo ln -s "$scoped_dir"/vendor/bin/codecept "$scoped_dir"/vendor/bin/codeception
|
||||||
elif [ "$tool" = "composer" ]; then
|
elif [ "$tool" = "composer" ]; then
|
||||||
|
26
src/tools.ts
26
src/tools.ts
@ -219,15 +219,25 @@ export async function addPackage(data: RS): Promise<string> {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export async function addBlackfirePlayer(data: RS): Promise<string> {
|
export async function addBlackfirePlayer(data: RS): Promise<string> {
|
||||||
if (data['version'] == 'latest') {
|
switch (data['os']) {
|
||||||
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
case 'win32':
|
||||||
data['version'] = '1.9.3';
|
return await utils.addLog(
|
||||||
} else if (/7\.[1-4]|8\.0/.test(data['php_version'])) {
|
'$cross',
|
||||||
data['version'] = '1.22.0';
|
data['tool'],
|
||||||
}
|
data['tool'] + ' is not a windows tool',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
data['url'] = await getPharUrl(data);
|
|
||||||
return addArchive(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user