Skip to content

Commit

Permalink
[ ci ] Grep only the digits from the GHC version
Browse files Browse the repository at this point in the history
  • Loading branch information
banacorn committed Nov 30, 2024
1 parent 3f010e1 commit df3b47b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: 🔍 Determine stack resolver & GHC
run: |
STACK_RESOLVER=$(yq .resolver stack.yaml)
GHC_VERSION=$(yq .compiler stack.yaml)
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
Expand All @@ -48,15 +48,14 @@ jobs:
# actions:

- name: ⏬ Install stack
run: |
# mkdir -p ~/.local/bin
# export PATH=~/.local/bin:$PATH
## Stack is preinstalled on the GHA runners
# curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
# if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
stack --version
- name: ⏬ Setup Haskell
uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ env.GHC_VERSION }}
enable-stack: true
stack-version: 'latest'

- name: ⏬ Install dependencies
run: |
stack build --only-dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: 🔍 Determine stack resolver & GHC
run: |
STACK_RESOLVER=$(yq .resolver stack.yaml)
GHC_VERSION=$(yq .compiler stack.yaml)
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: CI (Windows)

on:
push:
branches: [master, ci-*]
branches: [master, ci-*, ci]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
STACK_ROOT="C:/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows"
STACK_RESOLVER=$(yq .resolver stack.yaml)
GHC_VERSION=$(yq .compiler stack.yaml)
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}"
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
Expand Down

0 comments on commit df3b47b

Please sign in to comment.