Allow to set arbitrary tools in bindist action

Fixes #35
This commit is contained in:
Julian Ospald 2022-09-15 22:25:22 +08:00
parent fd71594ee6
commit 3f891cc56a
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F
2 changed files with 25 additions and 10 deletions

View File

@ -5,8 +5,12 @@ defaults:
on:
workflow_dispatch:
inputs:
ghcVersion:
description: GHC version
tool:
description: Tool
required: true
type: string
version:
description: Version
required: true
type: string
metadataFile:
@ -18,7 +22,8 @@ env:
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
BOOTSTRAP_HASKELL_MINIMAL: 1
BOOTSTRAP_HASKELL_ADJUST_BASHRC: 1
GHC_VERSION: ${{ github.event.inputs.ghcVersion }}
TOOL: ${{ github.event.inputs.tool }}
VERSION: ${{ github.event.inputs.version }}
METADATA_FILE: ${{ github.event.inputs.metadataFile }}
jobs:
bindist-install:
@ -60,7 +65,7 @@ jobs:
run: |
${{ matrix.installCmd }} curl bash git ${{ matrix.toolRequirements }}
- uses: actions/checkout@v3
- name: Install ghcup and bindist for GHC ${{ github.event.inputs.ghcVersion }}
- name: Install ghcup and bindist for ${{ github.event.inputs.tool }} ${{ github.event.inputs.version }}
run: .github/workflows/install-bindist.sh
bindist-install-non-linux:
name: ${{ matrix.os }}
@ -74,5 +79,5 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install ghcup and bindist for GHC ${{ github.event.inputs.ghcVersion }}
- name: Install ghcup and bindist for ${{ github.event.inputs.tool }} ${{ github.event.inputs.version }}
run: .github/workflows/install-bindist.sh

View File

@ -10,9 +10,19 @@ 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
ghcup -v --url-source=file:$METADATA_FILE install $TOOL --set $VERSION
ghc --version
echo 'main = print $ 1 + 1' > main.hs
ghc main.hs
[[ $(./main) -eq 2 ]]
case $TOOL in
hls)
haskell-language-server-wrapper --version
;;
ghc)
ghc --version
echo 'main = print $ 1 + 1' > main.hs
ghc main.hs
[[ $(./main) -eq 2 ]]
;;
*)
$TOOL --version
;;
esac