mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Added a condition for the $binGhcPath to not depend on the exact Haskell version (#3537)
This commit is contained in:
@@ -12,8 +12,8 @@ Describe "Haskell" {
|
|||||||
$ghcVersion = $_
|
$ghcVersion = $_
|
||||||
$ghcShortVersion = ([version]$ghcVersion).ToString(3)
|
$ghcShortVersion = ([version]$ghcVersion).ToString(3)
|
||||||
$binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe"
|
$binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe"
|
||||||
# Starting from version 9 haskell installation directory is $env:ChocolateyToolsLocation instead of $env:ChocolateyInstall\lib
|
# The most recent GHC versions installation directory is $env:ChocolateyToolsLocation instead of $env:ChocolateyInstall\lib
|
||||||
if ($ghcVersion -notmatch "^[0-8]\.\d+.*")
|
if (-not (Test-Path $binGhcPath))
|
||||||
{
|
{
|
||||||
$binGhcPath = Join-Path $env:ChocolateyToolsLocation "ghc-$ghcShortVersion\bin\ghc.exe"
|
$binGhcPath = Join-Path $env:ChocolateyToolsLocation "ghc-$ghcShortVersion\bin\ghc.exe"
|
||||||
}
|
}
|
||||||
@@ -36,11 +36,6 @@ Describe "Haskell" {
|
|||||||
"ghc --version" | Should -MatchCommandOutput $defaultGhcShortVersion
|
"ghc --version" | Should -MatchCommandOutput $defaultGhcShortVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sometimes choco doesn't return version 9, need to check it explicitly https://github.com/chocolatey/choco/issues/2271
|
|
||||||
It "Default GHC version is 9" -TestCases $ghcDefaultCases {
|
|
||||||
"ghc --version" | Should -MatchCommandOutput "9(\.\d+){2,}"
|
|
||||||
}
|
|
||||||
|
|
||||||
It "Cabal is installed" {
|
It "Cabal is installed" {
|
||||||
"cabal --version" | Should -ReturnZeroExitCode
|
"cabal --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user