Consolidate and isolate bindist installation
In particular, this now ensure that we actually use the ghcup version we installed as well as a separate installation directory, instead of any potentially previously installed versions/files.
This commit is contained in:
parent
0c0736526a
commit
0bdb62c58e
52
.github/workflows/bindists.yaml
vendored
52
.github/workflows/bindists.yaml
vendored
@ -14,6 +14,12 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
default: ghcup-0.0.7.yaml
|
default: ghcup-0.0.7.yaml
|
||||||
type: string
|
type: string
|
||||||
|
env:
|
||||||
|
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
|
||||||
|
BOOTSTRAP_HASKELL_MINIMAL: 1
|
||||||
|
BOOTSTRAP_HASKELL_ADJUST_BASHRC: 1
|
||||||
|
GHC_VERSION: ${{ github.event.inputs.ghcVersion }}
|
||||||
|
METADATA_FILE: ${{ github.event.inputs.metadataFile }}
|
||||||
jobs:
|
jobs:
|
||||||
bindist-install:
|
bindist-install:
|
||||||
name: linux-${{ matrix.image }}
|
name: linux-${{ matrix.image }}
|
||||||
@ -42,10 +48,10 @@ jobs:
|
|||||||
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||||
- image: archlinux:latest
|
- image: archlinux:latest
|
||||||
installCmd: pacman -Syu --noconfirm
|
installCmd: pacman -Syu --noconfirm
|
||||||
toolRequirements: gcc gmp libffi make ncurses perl tar xz
|
toolRequirements: which gcc gmp libffi make ncurses perl tar xz
|
||||||
- image: fedora:latest
|
- image: fedora:latest
|
||||||
installCmd: dnf install -y
|
installCmd: dnf install -y
|
||||||
toolRequirements: gcc g++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl
|
toolRequirements: which gcc g++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.image }}
|
image: ${{ matrix.image }}
|
||||||
steps:
|
steps:
|
||||||
@ -54,25 +60,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
${{ matrix.installCmd }} curl bash git ${{ matrix.toolRequirements }}
|
${{ matrix.installCmd }} curl bash git ${{ matrix.toolRequirements }}
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install ghcup
|
- name: Install ghcup and bindist for GHC ${{ github.event.inputs.ghcVersion }}
|
||||||
run: |
|
run: .github/workflows/install-bindist.sh
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
|
|
||||||
echo ~/.ghcup/bin >> $GITHUB_PATH
|
|
||||||
env:
|
|
||||||
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
|
|
||||||
BOOTSTRAP_HASKELL_MINIMAL: 1
|
|
||||||
- name: Print tool requirements
|
|
||||||
run: ghcup tool-requirements
|
|
||||||
- name: Install GHC ${{ github.event.inputs.ghcVersion }}
|
|
||||||
run: |
|
|
||||||
ghcup -v --url-source=file:${{ github.event.inputs.metadataFile }} \
|
|
||||||
install ghc --set ${{ github.event.inputs.ghcVersion }}
|
|
||||||
- name: GHC sanity check
|
|
||||||
run: |
|
|
||||||
ghc --version
|
|
||||||
echo 'main = print $ 1 + 1' > main.hs
|
|
||||||
ghc main.hs
|
|
||||||
[[ $(./main) -eq 2 ]]
|
|
||||||
bindist-install-non-linux:
|
bindist-install-non-linux:
|
||||||
name: ${{ matrix.os }}
|
name: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@ -85,22 +74,5 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install ghcup
|
- name: Install ghcup and bindist for GHC ${{ github.event.inputs.ghcVersion }}
|
||||||
run: |
|
run: .github/workflows/install-bindist.sh
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
|
|
||||||
echo ~/.ghcup/bin >> $GITHUB_PATH
|
|
||||||
env:
|
|
||||||
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
|
|
||||||
BOOTSTRAP_HASKELL_MINIMAL: 1
|
|
||||||
- name: Print tool requirements
|
|
||||||
run: ghcup tool-requirements
|
|
||||||
- name: Install GHC ${{ github.event.inputs.ghcVersion }}
|
|
||||||
run: |
|
|
||||||
ghcup -v --url-source=file:${{ github.event.inputs.metadataFile }} \
|
|
||||||
install ghc --set ${{ github.event.inputs.ghcVersion }}
|
|
||||||
- name: GHC sanity check
|
|
||||||
run: |
|
|
||||||
ghc --version
|
|
||||||
echo 'main = print $ 1 + 1' > main.hs
|
|
||||||
ghc main.hs
|
|
||||||
[[ $(./main) -eq 2 ]]
|
|
||||||
|
18
.github/workflows/install-bindist.sh
vendored
Executable file
18
.github/workflows/install-bindist.sh
vendored
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
export GHCUP_INSTALL_BASE_PREFIX=$RUNNER_TEMP/foobarbaz
|
||||||
|
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
|
||||||
|
|
||||||
|
source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env || source ~/.bashrc
|
||||||
|
|
||||||
|
ghcup --version
|
||||||
|
which ghcup | grep foobarbaz
|
||||||
|
|
||||||
|
ghcup -v --url-source=file:$METADATA_FILE install ghc --set $GHC_VERSION
|
||||||
|
|
||||||
|
ghc --version
|
||||||
|
echo 'main = print $ 1 + 1' > main.hs
|
||||||
|
ghc main.hs
|
||||||
|
[[ $(./main) -eq 2 ]]
|
Loading…
Reference in New Issue
Block a user