Skip to content

Commit 3f010e1

Browse files
committed
[ ci ] Setup Haskell environment on all platforms
1 parent 87195dc commit 3f010e1

File tree

3 files changed

+27
-40
lines changed

3 files changed

+27
-40
lines changed

.github/workflows/test-linux.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: CI (Linux)
44

55
on:
66
push:
7-
branches: [master, ci-*]
7+
branches: [master, ci-*, ci]
88
tags:
99
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
1010
pull_request:
@@ -18,10 +18,12 @@ jobs:
1818
- name: 📥 Checkout repository
1919
uses: actions/checkout@v4
2020

21-
- name: Determine stack resolver
21+
- name: 🔍 Determine stack resolver & GHC
2222
run: |
2323
STACK_RESOLVER=$(yq .resolver stack.yaml)
24+
GHC_VERSION=$(yq .compiler stack.yaml)
2425
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
26+
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
2527
2628
# things to be restored:
2729
# Include STACK_RESOLVER in cache key, otherwise caches accumulate build products for different resolvers.
@@ -55,12 +57,6 @@ jobs:
5557
# 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
5658
stack --version
5759
58-
- name: ⏬ Install GHC
59-
run: |
60-
df -h
61-
stack setup --install-ghc
62-
df -h
63-
6460
- name: ⏬ Install dependencies
6561
run: |
6662
stack build --only-dependencies

.github/workflows/test-mac.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ jobs:
1818
- name: 📥 Checkout repository
1919
uses: actions/checkout@v4
2020

21-
- name: 🔍 Determine stack resolver
21+
- name: 🔍 Determine stack resolver & GHC
2222
run: |
2323
STACK_RESOLVER=$(yq .resolver stack.yaml)
24+
GHC_VERSION=$(yq .compiler stack.yaml)
2425
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
26+
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
2527
2628
# things to be restored:
2729
# Include STACK_RESOLVER in cache key, otherwise caches accumulate build products for different resolvers.
@@ -54,23 +56,10 @@ jobs:
5456
uses: haskell-actions/setup@v2
5557
id: setup-haskell
5658
with:
57-
ghc-version: '9.2.8'
59+
ghc-version: ${{ env.GHC_VERSION }}
5860
enable-stack: true
5961
stack-version: 'latest'
6062

61-
# - name: ⏬ Install stack
62-
# run: |
63-
# # mkdir -p ~/.local/bin
64-
# # export PATH=~/.local/bin:$PATH
65-
# ## Stack is preinstalled on the GHA runners
66-
# # brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
67-
# # if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
68-
# stack --version
69-
70-
# - name: ⏬ Install GHC
71-
# run: |
72-
# stack setup --install-ghc
73-
7463
- name: ⏬ Install dependencies
7564
run: |
7665
stack build --only-dependencies

.github/workflows/test-windows.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ jobs:
2525
- name: 🏗 Install yq
2626
uses: frenck/action-setup-yq@v1
2727

28-
- name: Determine stack root and resolver
28+
- name: 🔍 Determine stack root and resolver and GHC
2929
## 2023-11-21 https://github.com/commercialhaskell/stack/issues/6340
3030
## Asking stack for the stack root unfortunately does not work
3131
## if stack is not fully operational (meaning e.g. that GHC is installed)
3232
## so we hardcode its location instead.
3333
run: |
3434
STACK_ROOT="C:/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows"
3535
STACK_RESOLVER=$(yq .resolver stack.yaml)
36+
GHC_VERSION=$(yq .compiler stack.yaml)
3637
echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}"
3738
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
39+
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
3840
# run: |
3941
# STACK_ROOT="$(stack --system-ghc --no-install-ghc path --stack-root || echo "C:/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows")"
4042
# echo "STACK_ROOT = ${STACK_ROOT}"
@@ -64,22 +66,22 @@ jobs:
6466
6567
# actions
6668

67-
- name: ⏬ Install stack
68-
## Stack is preinstalled on GHA runners.
69-
#
70-
#if: steps.stack-programs-dir.outputs.cache-hit != 'true'
71-
# this step is needed to get stack.exe into PATH, for now
72-
# curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip
73-
# 7z x stack.zip stack.exe
74-
run: |
75-
which stack
76-
stack --version
77-
78-
- name: ⏬ Install GHC
79-
# if: steps.stack-programs-dir.outputs.cache-hit != 'true'
80-
# set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
81-
run: |
82-
stack --no-terminal setup --install-ghc
69+
# - name: ⏬ Install stack
70+
# ## Stack is preinstalled on GHA runners.
71+
# #
72+
# #if: steps.stack-programs-dir.outputs.cache-hit != 'true'
73+
# # this step is needed to get stack.exe into PATH, for now
74+
# # curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip
75+
# # 7z x stack.zip stack.exe
76+
# run: |
77+
# which stack
78+
# stack --version
79+
80+
# - name: ⏬ Install GHC
81+
# # if: steps.stack-programs-dir.outputs.cache-hit != 'true'
82+
# # set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
83+
# run: |
84+
# stack --no-terminal setup --install-ghc
8385

8486
- name: Install the icu library
8587
run: |

0 commit comments

Comments
 (0)