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"',
|
||||||
|
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -826,6 +826,10 @@ async function addPackage(data) {
|
|||||||
}
|
}
|
||||||
exports.addPackage = addPackage;
|
exports.addPackage = addPackage;
|
||||||
async function addBlackfirePlayer(data) {
|
async function addBlackfirePlayer(data) {
|
||||||
|
switch (data['os']) {
|
||||||
|
case 'win32':
|
||||||
|
return await utils.addLog('$cross', data['tool'], data['tool'] + ' is not a windows tool', 'win32');
|
||||||
|
default:
|
||||||
if (data['version'] == 'latest') {
|
if (data['version'] == 'latest') {
|
||||||
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
||||||
data['version'] = '1.9.3';
|
data['version'] = '1.9.3';
|
||||||
@ -837,6 +841,7 @@ async function addBlackfirePlayer(data) {
|
|||||||
data['url'] = await getPharUrl(data);
|
data['url'] = await getPharUrl(data);
|
||||||
return addArchive(data);
|
return addArchive(data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
exports.addBlackfirePlayer = addBlackfirePlayer;
|
exports.addBlackfirePlayer = addBlackfirePlayer;
|
||||||
async function addCastor(data) {
|
async function addCastor(data) {
|
||||||
data['tool'] = 'castor.' + data['os'].replace('win32', 'windows') + '-amd64';
|
data['tool'] = 'castor.' + data['os'].replace('win32', 'windows') + '-amd64';
|
||||||
|
@ -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
|
||||||
|
10
src/tools.ts
10
src/tools.ts
@ -219,6 +219,15 @@ 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> {
|
||||||
|
switch (data['os']) {
|
||||||
|
case 'win32':
|
||||||
|
return await utils.addLog(
|
||||||
|
'$cross',
|
||||||
|
data['tool'],
|
||||||
|
data['tool'] + ' is not a windows tool',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
default:
|
||||||
if (data['version'] == 'latest') {
|
if (data['version'] == 'latest') {
|
||||||
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
||||||
data['version'] = '1.9.3';
|
data['version'] = '1.9.3';
|
||||||
@ -229,6 +238,7 @@ export async function addBlackfirePlayer(data: RS): Promise<string> {
|
|||||||
data['url'] = await getPharUrl(data);
|
data['url'] = await getPharUrl(data);
|
||||||
return addArchive(data);
|
return addArchive(data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to add Castor
|
* Function to add Castor
|
||||||
|
Loading…
Reference in New Issue
Block a user