mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +00:00
[Ubuntu] Install the latest two versions of GHC (#2696)
* install two ghc versions * fix comments
This commit is contained in:
committed by
GitHub
parent
77b21e0c24
commit
06559cab21
@@ -13,9 +13,9 @@ apt-get install -y software-properties-common
|
|||||||
add-apt-repository -y ppa:hvr/ghc
|
add-apt-repository -y ppa:hvr/ghc
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
||||||
# Get 3 latest Haskell Major.Minor versions
|
# Get 2 latest Haskell Major.Minor versions
|
||||||
allGhcVersions=$(apt-cache search "^ghc-" | grep -Po '(\d*\.){2}\d*' | sort --unique --version-sort)
|
allGhcVersions=$(apt-cache search "^ghc-" | grep -Po '(\d*\.){2}\d*' | sort --unique --version-sort)
|
||||||
ghcMajorMinorVersions=$(echo "$allGhcVersions" | cut -d "." -f 1,2 | sort --unique --version-sort | tail -3)
|
ghcMajorMinorVersions=$(echo "$allGhcVersions" | cut -d "." -f 1,2 | sort --unique --version-sort | tail -2)
|
||||||
|
|
||||||
for version in $ghcMajorMinorVersions; do
|
for version in $ghcMajorMinorVersions; do
|
||||||
# Get latest patch version for given Major.Minor one (ex. 8.6.5 for 8.6) and install it
|
# Get latest patch version for given Major.Minor one (ex. 8.6.5 for 8.6) and install it
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ Describe "Haskell" {
|
|||||||
|
|
||||||
$testCase = @{ GHCVersions = $GHCVersions }
|
$testCase = @{ GHCVersions = $GHCVersions }
|
||||||
|
|
||||||
It "GHC directory contains three version of GHC" -TestCases $testCase {
|
It "GHC directory contains two version of GHC" -TestCases $testCase {
|
||||||
param ([object] $GHCVersions)
|
param ([object] $GHCVersions)
|
||||||
$GHCVersions.Count | Should -Be 3
|
$GHCVersions.Count | Should -Be 2
|
||||||
}
|
}
|
||||||
|
|
||||||
$testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} }
|
$testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} }
|
||||||
|
|||||||
Reference in New Issue
Block a user