[macOS] Add GCC 11 (#3361)

* Add gcc@11 to macOS images

* Change tests and software report to use gcc toolset versions

* Add natural sort
This commit is contained in:
Mikhail Timofeev
2021-05-13 11:45:33 +03:00
committed by GitHub
parent 3b20fa31db
commit 0f3523c0af
7 changed files with 40 additions and 13 deletions

View File

@@ -1,15 +1,16 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
echo "Installing GCC@8 using homebrew..."
brew_smart_install "gcc@8"
gccVersions=$(get_toolset_value '.gcc.versions | .[]')
echo "Installing GCC@9 using homebrew..."
brew_smart_install "gcc@9"
for gccVersion in $gccVersions; do
brew_smart_install "gcc@${gccVersion}"
done
# https://github.com/actions/virtual-environments/issues/1280
echo "Installing GCC@10 using homebrew..."
brew_smart_install "gcc@10"
rm $(which gfortran)
# Delete default gfortran link if it exists https://github.com/actions/virtual-environments/issues/1280
gfortranPath=$(which gfortran)
if [ $gfortranPath ]; then
rm $gfortranPath
fi
invoke_tests "Common" "GCC"

View File

@@ -80,7 +80,7 @@ function Get-VcpkgVersion {
}
function Get-GccVersion {
$versionList = @("8", "9", "10")
$versionList = Get-ToolsetValue -KeyPath gcc.versions
$versionList | Foreach-Object {
$version = Run-Command "gcc-${_} --version" | Select-Object -First 1
"$version - available by ``gcc-${_}`` alias"
@@ -88,10 +88,10 @@ function Get-GccVersion {
}
function Get-FortranVersion {
$versionList = @("8", "9", "10")
$versionList = Get-ToolsetValue -KeyPath gcc.versions
$versionList | Foreach-Object {
$version = Run-Command "gfortran-${_} --version" | Select-Object -First 1
"$version - available by ``gfortran-${_}`` alias"
"$version - available by ``gfortran-${_}`` alias"
}
}

View File

@@ -60,7 +60,9 @@ if ($os.IsLessThanBigSur) {
)
}
$markdown += New-MDList -Style Unordered -Lines ($languageAndRuntimeList | Sort-Object)
# To sort GCC and Gfortran correctly, we need to use natural sort https://gist.github.com/markwragg/e2a9dc05f3464103d6998298fb575d4e#file-sort-natural-ps1
$toNatural = { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
$markdown += New-MDList -Style Unordered -Lines ($languageAndRuntimeList | Sort-Object $toNatural)
# Package Management
$markdown += New-MDHeader "Package Management" -Level 3

View File

@@ -10,7 +10,7 @@ Describe ".NET" {
}
Describe "GCC" -Skip:($os.IsHighSierra) {
$testCases = @("8", "9", "10") | ForEach-Object { @{Version = $_} }
$testCases = Get-ToolsetValue -KeyPath gcc.versions | ForEach-Object { @{Version = $_} }
It "GCC <Version>" -TestCases $testCases {
param (

View File

@@ -263,6 +263,14 @@
"virtualbox"
]
},
"gcc": {
"versions": [
"8",
"9",
"10",
"11"
]
},
"toolcache": [
{
"name": "Python",

View File

@@ -222,6 +222,14 @@
"virtualbox"
]
},
"gcc": {
"versions": [
"8",
"9",
"10",
"11"
]
},
"toolcache": [
{
"name": "Python",

View File

@@ -150,6 +150,14 @@
"julia"
]
},
"gcc": {
"versions": [
"8",
"9",
"10",
"11"
]
},
"toolcache": [
{
"name": "Python",