Skip to content

Commit 1b033c7

Browse files
parsonsmattclaude
andauthored
Add Stack dependency caching to CI (#1904)
Replace the commented-out actions/cache@v1 with actions/cache@v4. Caches ~/.stack (GHC installations and snapshot packages) keyed by OS, resolver args, and hashes of cabal/stack config files. Includes a cleanup step to remove lock files that previously caused macOS issues with cache@v1. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b8e88e6 commit 1b033c7

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/tests.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,18 @@ jobs:
3131
- name: Clone project
3232
uses: actions/checkout@v4
3333

34-
# Getting weird OS X errors...
35-
# - name: Cache dependencies
36-
# uses: actions/cache@v1
37-
# with:
38-
# path: ~/.stack
39-
# key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}
40-
# restore-keys: |
41-
# ${{ runner.os }}-${{ matrix.resolver }}-
34+
- name: Cache Stack dependencies
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.stack
38+
key: stack-${{ runner.os }}-${{ matrix.args }}-${{ hashFiles('**/*.cabal', 'stack.yaml', 'stack-lts-22.yaml') }}
39+
restore-keys: |
40+
stack-${{ runner.os }}-${{ matrix.args }}-
41+
stack-${{ runner.os }}-
42+
43+
- name: Remove Stack lock files
44+
shell: bash
45+
run: rm -rf ~/.stack/setup-exe-cache ~/.stack/pantry/pantry.sqlite3.pantry-write-lock
4246

4347
- name: Install stack if needed
4448
shell: bash

0 commit comments

Comments
 (0)