mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[ubuntu] Rename build scripts (#8866)
* [ubuntu] Rename build scripts * [ubuntu] Change reboot to inline shell * [ubuntu] Move disk space validation to pester tests * [ubuntu] Rename helper and tests files * [ubuntu] Changes to cleanup, post-deployment and r scripts
This commit is contained in:
committed by
GitHub
parent
410fd620be
commit
1bd9214f41
44
images/ubuntu/scripts/build/install-haskell.sh
Normal file
44
images/ubuntu/scripts/build/install-haskell.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash -e
|
||||
################################################################################
|
||||
## File: install-haskell.sh
|
||||
## Desc: Install Haskell, GHCup, Cabal and Stack
|
||||
################################################################################
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/etc-environment.sh
|
||||
|
||||
# Any nonzero value for noninteractive installation
|
||||
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
|
||||
export BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1
|
||||
export GHCUP_INSTALL_BASE_PREFIX=/usr/local
|
||||
export BOOTSTRAP_HASKELL_GHC_VERSION=0
|
||||
ghcup_bin=$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin
|
||||
setEtcEnvironmentVariable "BOOTSTRAP_HASKELL_NONINTERACTIVE" $BOOTSTRAP_HASKELL_NONINTERACTIVE
|
||||
setEtcEnvironmentVariable "GHCUP_INSTALL_BASE_PREFIX" $GHCUP_INSTALL_BASE_PREFIX
|
||||
|
||||
# Install GHCup
|
||||
curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | sh > /dev/null 2>&1 || true
|
||||
export PATH="$ghcup_bin:$PATH"
|
||||
prependEtcEnvironmentPath $ghcup_bin
|
||||
|
||||
availableVersions=$(ghcup list -t ghc -r | grep -v "prerelease" | awk '{print $2}')
|
||||
|
||||
# Get 2 latest Haskell Major.Minor versions
|
||||
minorMajorVersions=$(echo "$availableVersions" | cut -d"." -f 1,2 | uniq | tail -n2)
|
||||
for majorMinorVersion in $minorMajorVersions; do
|
||||
fullVersion=$(echo "$availableVersions" | grep "$majorMinorVersion." | tail -n1)
|
||||
echo "install ghc version $fullVersion..."
|
||||
ghcup install ghc $fullVersion
|
||||
ghcup set ghc $fullVersion
|
||||
done
|
||||
|
||||
echo "install cabal..."
|
||||
ghcup install cabal latest
|
||||
|
||||
chmod -R 777 $GHCUP_INSTALL_BASE_PREFIX/.ghcup
|
||||
ln -s $GHCUP_INSTALL_BASE_PREFIX/.ghcup /etc/skel/.ghcup
|
||||
|
||||
# Install the latest stable release of haskell stack
|
||||
curl -fsSL https://get.haskellstack.org/ | sh
|
||||
|
||||
invoke_tests "Haskell"
|
||||
Reference in New Issue
Block a user