mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +00:00
See https://github.com/commercialhaskell/stack/issues/5895 Stack feature is documented here: https://docs.haskellstack.org/en/stable/yaml_configuration/#ghc-installation-customisation It's recommended, but probably too unexpected for CI. It means stack will not install GHC on its own, but through GHCup.
39 lines
1.0 KiB
PowerShell
39 lines
1.0 KiB
PowerShell
Describe "Haskell" {
|
|
$GHCCommonPath = "/usr/local/.ghcup/ghc"
|
|
$GHCVersions = Get-ChildItem -Path $GHCCommonPath | Where-Object { $_.Name -match "\d+\.\d+" }
|
|
|
|
$testCase = @{ GHCVersions = $GHCVersions }
|
|
|
|
It "GHC directory contains two version of GHC" -TestCases $testCase {
|
|
param ([object] $GHCVersions)
|
|
$GHCVersions.Count | Should -Be 2
|
|
}
|
|
|
|
$testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} }
|
|
|
|
It "GHC version <GHCPath>" -TestCases $testCases {
|
|
param ([string] $GHCPath)
|
|
"$GHCPath --version" | Should -ReturnZeroExitCode
|
|
}
|
|
|
|
It "GHCup" {
|
|
"ghcup --version" | Should -ReturnZeroExitCode
|
|
}
|
|
|
|
It "Default GHC" {
|
|
"ghc --version" | Should -ReturnZeroExitCode
|
|
}
|
|
|
|
It "Cabal" {
|
|
"cabal --version" | Should -ReturnZeroExitCode
|
|
}
|
|
|
|
It "Stack" {
|
|
"stack --version" | Should -ReturnZeroExitCode
|
|
}
|
|
|
|
It "Stack hook is not installed" {
|
|
"$HOME/.stack/hooks/ghc-install.sh" | Should -Not -Exist
|
|
}
|
|
}
|