From d0dd391b7015169858e0a765d5a3c76c5fa966f7 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Thu, 3 Dec 2020 18:40:19 +0300 Subject: [PATCH] [macos] install gfortran-10 (#2186) --- images/macos/provision/core/gcc.sh | 7 ++++++- images/macos/software-report/SoftwareReport.Common.psm1 | 4 ++-- images/macos/tests/Common.Tests.ps1 | 8 ++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/images/macos/provision/core/gcc.sh b/images/macos/provision/core/gcc.sh index fefe20fd..44a7ec13 100644 --- a/images/macos/provision/core/gcc.sh +++ b/images/macos/provision/core/gcc.sh @@ -4,4 +4,9 @@ echo "Installing GCC@8 using homebrew..." brew install gcc@8 echo "Installing GCC@9 using homebrew..." -brew install gcc@9 \ No newline at end of file +brew install gcc@9 + +# https://github.com/actions/virtual-environments/issues/1280 +echo "Installing GCC@10 using homebrew..." +brew install gcc@10 +rm $(which gfortran) \ No newline at end of file diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index 7616b81b..0bed5e94 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -55,7 +55,7 @@ function Get-VcpkgVersion { } function Get-GccVersion { - $versionList = @("8", "9") + $versionList = @("8", "9", "10") $versionList | Foreach-Object { $version = Run-Command "gcc-${_} --version" | Select-Object -First 1 "$version - available by ``gcc-${_}`` alias" @@ -63,7 +63,7 @@ function Get-GccVersion { } function Get-FortranVersion { - $versionList = @("8", "9") + $versionList = @("8", "9", "10") $versionList | Foreach-Object { $version = Run-Command "gfortran-${_} --version" | Select-Object -First 1 "$version - available by ``gfortran-${_}`` alias" diff --git a/images/macos/tests/Common.Tests.ps1 b/images/macos/tests/Common.Tests.ps1 index 88d735bf..9e80ad48 100644 --- a/images/macos/tests/Common.Tests.ps1 +++ b/images/macos/tests/Common.Tests.ps1 @@ -327,7 +327,7 @@ Describe "Clang/LLVM" -Skip:($os.IsHighSierra) { } Describe "Gcc" -Skip:($os.IsHighSierra) { - $testCases = @("8", "9") | ForEach-Object { @{GccVersion = $_} } + $testCases = @("8", "9", "10") | ForEach-Object { @{GccVersion = $_} } It "Gcc " -TestCases $testCases { param ( @@ -339,7 +339,7 @@ Describe "Gcc" -Skip:($os.IsHighSierra) { } Describe "Gfortran" -Skip:($os.IsHighSierra) { - $testCases = @("8", "9") | ForEach-Object { @{GfortranVersion = $_} } + $testCases = @("8", "9", "10") | ForEach-Object { @{GfortranVersion = $_} } It "Gfortran " -TestCases $testCases { param ( @@ -348,6 +348,10 @@ Describe "Gfortran" -Skip:($os.IsHighSierra) { "gfortran-$GfortranVersion --version" | Should -ReturnZeroExitCode } + + It "Gfortran is not found in the default path" { + "$(which gfortran)" | Should -BeNullOrEmpty + } } Describe "Screen Resolution" -Skip:($os.IsHighSierra) {