Skip to content

Commit bc9458c

Browse files
committed
[ ci ] Remove hardcoded Stack root on Unix
1 parent aaaad2f commit bc9458c

File tree

2 files changed

+56
-32
lines changed

2 files changed

+56
-32
lines changed

.github/workflows/test-unix.yaml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
name: CI (Unix)
44

5+
defaults:
6+
run:
7+
shell: bash
8+
59
on:
610
push:
711
branches: [master, ci-*, ci]
@@ -25,13 +29,26 @@ jobs:
2529
- name: 🏗 Install yq
2630
uses: frenck/action-setup-yq@v1
2731

28-
- name: 🔍 Determine stack resolver & GHC
32+
- name: 🔍 Determine Stack resolver & GHC version
2933
run: |
30-
STACK_ROOT="$(stack path --stack-root)"
3134
STACK_RESOLVER=$(yq .resolver stack.yaml)
3235
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
3336
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
34-
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
37+
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
38+
39+
- name: 🏗 Setup Haskell
40+
if : runner.os == 'macOS'
41+
uses: haskell-actions/setup@v2
42+
id: setup-haskell
43+
with:
44+
ghc-version: ${{ env.GHC_VERSION }}
45+
enable-stack: true
46+
stack-version: 'latest'
47+
48+
- name: 🔍 Determine Stack root
49+
run: |
50+
STACK_ROOT="$(stack path --stack-root)"
51+
echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}"
3552
3653
# things to be restored:
3754
# Include STACK_RESOLVER in cache key, otherwise caches accumulate build products for different resolvers.
@@ -60,13 +77,13 @@ jobs:
6077
run: |
6178
echo PKG_CONFIG_PATH="$(brew --prefix)/opt/icu4c/lib/pkgconfig" >> "${GITHUB_ENV}"
6279
63-
- name: ⏬ Setup Haskell
64-
uses: haskell-actions/setup@v2
65-
id: setup-haskell
66-
with:
67-
ghc-version: ${{ env.GHC_VERSION }}
68-
enable-stack: true
69-
stack-version: 'latest'
80+
# - name: ⏬ Setup Haskell
81+
# uses: haskell-actions/setup@v2
82+
# id: setup-haskell
83+
# with:
84+
# ghc-version: ${{ env.GHC_VERSION }}
85+
# enable-stack: true
86+
# stack-version: 'latest'
7087

7188
- name: 🔨 Build
7289
run: stack build

.github/workflows/test-windows.yaml

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

28-
- name: 🔍 Determine stack root and resolver and GHC
28+
- name: 🔍 Determine Stack resolver & GHC version
2929
run: |
30-
STACK_ROOT="$(stack path --stack-root)"
3130
STACK_RESOLVER=$(yq .resolver stack.yaml)
3231
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
33-
echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}"
3432
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
35-
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
36-
# run: |
37-
# STACK_ROOT="$(stack --system-ghc --no-install-ghc path --stack-root || echo "C:/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows")"
38-
# echo "STACK_ROOT = ${STACK_ROOT}"
39-
# echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}"
40-
# What about C:/Users/runneradmin/AppData/Roaming/stack ?
33+
echo GHC_VERSION="${GHC_VERSION}" >> "${GITHUB_ENV}"
34+
35+
- name: 🏗 Setup Haskell
36+
if : runner.os == 'macOS'
37+
uses: haskell-actions/setup@v2
38+
id: setup-haskell
39+
with:
40+
ghc-version: ${{ env.GHC_VERSION }}
41+
enable-stack: true
42+
stack-version: 'latest'
43+
44+
- name: 🔍 Determine Stack root
45+
run: |
46+
STACK_ROOT="$(stack path --stack-root)"
47+
echo STACK_ROOT="${STACK_ROOT}" >> "${GITHUB_ENV}"
4148
4249
# things to be restored:
4350
# Include STACK_RESOLVER in cache key, otherwise caches accumulate build products for different resolvers.
@@ -65,23 +72,23 @@ jobs:
6572
run: |
6673
stack exec -- pacman -S --noconfirm mingw-w64-x86_64-icu mingw-w64-x86_64-pkgconf
6774
68-
# - name: 📸 Build Snapshot
69-
# run: |
70-
# stack build --no-terminal --only-snapshot -j1
75+
- name: 📸 Build Snapshot
76+
run: |
77+
stack build --no-terminal --only-snapshot -j1
7178
72-
# - name: 🧰 Build Dependencies
73-
# run: |
74-
# stack build --no-terminal --only-dependencies
79+
- name: 🧰 Build Dependencies
80+
run: |
81+
stack build --no-terminal --only-dependencies
7582
76-
# - name: 🔨 Build and run tests
77-
# run: |
78-
# stack test
83+
- name: 🧪 Run tests
84+
run: |
85+
stack test
7986
80-
- name: 🔨 Build
81-
run: stack build
87+
# - name: 🔨 Build
88+
# run: stack build
8289

83-
- name: 🧪 Run tests
84-
run: stack test
90+
# - name: 🧪 Run tests
91+
# run: stack test
8592

8693
# things to be cached
8794

0 commit comments

Comments
 (0)