Skip to content

Commit aaaad2f

Browse files
committed
[ ci ] Remove hardcoded Stack root on Windows
1 parent cc318c4 commit aaaad2f

File tree

4 files changed

+33
-361
lines changed

4 files changed

+33
-361
lines changed

.github/workflows/test-linux.yaml

Lines changed: 0 additions & 111 deletions
This file was deleted.

.github/workflows/test-mac.yaml

Lines changed: 0 additions & 203 deletions
This file was deleted.

.github/workflows/test-unix.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ jobs:
2222
- name: 📥 Checkout repository
2323
uses: actions/checkout@v4
2424

25+
- name: 🏗 Install yq
26+
uses: frenck/action-setup-yq@v1
27+
2528
- name: 🔍 Determine stack resolver & GHC
2629
run: |
30+
STACK_ROOT="$(stack path --stack-root)"
2731
STACK_RESOLVER=$(yq .resolver stack.yaml)
2832
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
2933
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
@@ -36,7 +40,7 @@ jobs:
3640
id: stack-global
3741
uses: actions/cache/restore@v4
3842
with:
39-
path: ~/.stack
43+
path: ${{ env.STACK_ROOT }}
4044
key: ${{ runner.os }}-stack-resolver-${{ env.STACK_RESOLVER }}-global-${{ hashFiles('**.yaml') }}
4145
restore-keys: |
4246
${{ runner.os }}-stack-resolver-${{ env.STACK_RESOLVER }}-global
@@ -64,26 +68,24 @@ jobs:
6468
enable-stack: true
6569
stack-version: 'latest'
6670

67-
- name: ⏬ Install dependencies
68-
run: |
69-
stack build
71+
- name: 🔨 Build
72+
run: stack build
7073

71-
- name: 🔨 Build and run tests
72-
run: |
73-
stack test
74+
- name: 🧪 Run tests
75+
run: stack test
7476

7577
# things to be cached
7678

7779
- name: 💾 Cache stack global package db
7880
if: always() && steps.stack-global.outputs.cache-hit != 'true'
79-
uses: actions/cache/save@v3
81+
uses: actions/cache/save@v4
8082
with:
81-
path: ~/.stack
83+
path: ${{ env.STACK_ROOT }}
8284
key: ${{ steps.stack-global.outputs.cache-primary-key }}
8385

8486
- name: 💾 Cache .stack-work
8587
if: always() && steps.stack-work.outputs.cache-hit != 'true'
86-
uses: actions/cache/save@v3
88+
uses: actions/cache/save@v4
8789
with:
8890
path: .stack-work
8991
key: ${{ steps.stack-work.outputs.cache-primary-key }}
@@ -215,7 +217,7 @@ jobs:
215217
216218
- name: 🔨 Build and run tests
217219
run: |
218-
220+
219221
stack test --ta --als-path=zip/als
220222
221223
# release (optional)

0 commit comments

Comments
 (0)