Skip to content

Commit

Permalink
[ ci ] Remove hardcoded Stack root on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
banacorn committed Dec 3, 2024
1 parent cc318c4 commit aaaad2f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 361 deletions.
111 changes: 0 additions & 111 deletions .github/workflows/test-linux.yaml

This file was deleted.

203 changes: 0 additions & 203 deletions .github/workflows/test-mac.yaml

This file was deleted.

24 changes: 13 additions & 11 deletions .github/workflows/test-unix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: 🏗 Install yq
uses: frenck/action-setup-yq@v1

- name: 🔍 Determine stack resolver & GHC
run: |
STACK_ROOT="$(stack path --stack-root)"
STACK_RESOLVER=$(yq .resolver stack.yaml)
GHC_VERSION=$(echo $(yq .compiler stack.yaml) | cut -c 5-)
echo STACK_RESOLVER="${STACK_RESOLVER}" >> "${GITHUB_ENV}"
Expand All @@ -36,7 +40,7 @@ jobs:
id: stack-global
uses: actions/cache/restore@v4
with:
path: ~/.stack
path: ${{ env.STACK_ROOT }}
key: ${{ runner.os }}-stack-resolver-${{ env.STACK_RESOLVER }}-global-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-resolver-${{ env.STACK_RESOLVER }}-global
Expand Down Expand Up @@ -64,26 +68,24 @@ jobs:
enable-stack: true
stack-version: 'latest'

- name: ⏬ Install dependencies
run: |
stack build
- name: 🔨 Build
run: stack build

- name: 🔨 Build and run tests
run: |
stack test
- name: 🧪 Run tests
run: stack test

# things to be cached

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

- name: 💾 Cache .stack-work
if: always() && steps.stack-work.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: .stack-work
key: ${{ steps.stack-work.outputs.cache-primary-key }}
Expand Down Expand Up @@ -215,7 +217,7 @@ jobs:
- name: 🔨 Build and run tests
run: |
stack test --ta --als-path=zip/als
# release (optional)
Expand Down
Loading

0 comments on commit aaaad2f

Please sign in to comment.