Skip to content

Commit ef3b767

Browse files
committed
Fix caching of gen-hie
1 parent 00f28dd commit ef3b767

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/haskell.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -507,37 +507,37 @@ jobs:
507507
run: ./scripts/cabal-format.sh check
508508

509509
gen-hie:
510+
name: Generate HIE files
510511
runs-on: ubuntu-latest
511512

512-
defaults:
513-
run:
514-
shell: bash
515-
516-
strategy:
517-
fail-fast: false
518-
519513
steps:
514+
- name: Set up installation directory
515+
run: |
516+
BINDIR=$HOME/.local/bin
517+
echo "bindir=$BINDIR" >> "$GITHUB_ENV"
518+
echo "$BINDIR" >> "$GITHUB_PATH"
519+
520520
- name: Cache implicit-hie executable (gen-hie)
521521
id: cache-gen-hie
522522
uses: actions/cache@v5
523523
with:
524-
path: |
525-
~/.cabal/bin/gen-hie
524+
path: ${{ env.bindir }}/gen-hie
526525
key: ${{ runner.os }}-cache-gen-hie
527526

528527
- name: Install Haskell
528+
if: steps.cache-gen-hie.outputs.cache-hit != 'true'
529529
id: install-haskell
530530
uses: input-output-hk/actions/haskell@latest
531531
with:
532532
ghc-version: 9.10.1
533533
cabal-version: 3.16
534534

535-
- name: Install gen-hie if not cached
535+
- name: Install gen-hie
536536
if: steps.cache-gen-hie.outputs.cache-hit != 'true'
537-
run: cabal update && cabal install implicit-hie --install-method=copy --overwrite-policy=always
538-
539-
- name: Add cabal-bin to PATH
540-
run: echo "$HOME/.cabal/bin" >> $GITHUB_PATH
537+
run: |
538+
cabal update
539+
cabal install implicit-hie \
540+
--installdir=${{ env.bindir }} --install-method=copy --overwrite-policy=always
541541
542542
- uses: actions/checkout@v6
543543

0 commit comments

Comments
 (0)