mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[Ubuntu] Tight composer version to 2.2.9 for Ubuntu Server 18 (#5321)
* [Ubuntu] Tight composer verstion to 2.2.9 for Ubuntu Server 18 * Remove extra line * remove double quotes
This commit is contained in:
committed by
GitHub
parent
a5d2e20fbc
commit
f052b4c10f
@@ -236,8 +236,14 @@ function Get-PHPVersions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-ComposerVersion {
|
function Get-ComposerVersion {
|
||||||
$(composer --version) -match "Composer version (?<version>\d+\.\d+\.\d+)\s" | Out-Null
|
$rawVersion = composer --version
|
||||||
return $Matches.version
|
if (Test-IsUbuntu18) {
|
||||||
|
$rawVersion -match "Composer version (?<version>\d+\.\d+\.\d+)\s" | Out-Null
|
||||||
|
$composerVersion = $Matches.version
|
||||||
|
} else {
|
||||||
|
$composerVersion = $rawVersion | Take-OutputPart -Part 1
|
||||||
|
}
|
||||||
|
return $composerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PHPUnitVersion {
|
function Get-PHPUnitVersion {
|
||||||
|
|||||||
@@ -96,7 +96,12 @@ apt-get install -y --no-install-recommends snmp
|
|||||||
# Install composer
|
# Install composer
|
||||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
php -r "if (hash_file('sha384', 'composer-setup.php') === file_get_contents('https://composer.github.io/installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
php -r "if (hash_file('sha384', 'composer-setup.php') === file_get_contents('https://composer.github.io/installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||||
php composer-setup.php
|
# Composer 2.3 increased the required PHP version to >=7.2.5 and thus stop supporting PHP 5.3.2 - 7.2.4
|
||||||
|
if isUbuntu18; then
|
||||||
|
php composer-setup.php --version=2.2.9
|
||||||
|
else
|
||||||
|
php composer-setup.php
|
||||||
|
fi
|
||||||
sudo mv composer.phar /usr/bin/composer
|
sudo mv composer.phar /usr/bin/composer
|
||||||
php -r "unlink('composer-setup.php');"
|
php -r "unlink('composer-setup.php');"
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ Describe "PHP" {
|
|||||||
"composer --version" | Should -ReturnZeroExitCode
|
"composer --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It "Composer 2.2.9 on Ubuntu Server 18" -Skip:(-not (Test-IsUbuntu18)) {
|
||||||
|
composer --version | Should -Match "2.2.9"
|
||||||
|
}
|
||||||
|
|
||||||
It "Pear" {
|
It "Pear" {
|
||||||
"pear" | Should -ReturnZeroExitCode
|
"pear" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user