Skip to content

Commit d3b951d

Browse files
sgillespiekderme
authored andcommitted
build(ci): [Re]Add CABAL_CACHE_VERSION to the GitHub workflow
1 parent ad63bd8 commit d3b951d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.github/workflows/haskell.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
- os: macos-latest
2626
compiler-nix-name: ghc96
2727

28+
env:
29+
# Increment this value to "invalidate" the cabal cache. Be sure to do this
30+
# after updating dependencies (Hackage or chap)
31+
CABAL_CACHE_VERSION: 1
32+
2833
steps:
2934
- name: Checkout code
3035
uses: actions/checkout@v3
@@ -48,8 +53,8 @@ jobs:
4853
path: |
4954
~/.cabal-devx/packages
5055
~/.cabal-devx/store
51-
key: ${{ runner.os }}-${{ matrix.compiler-nix-name }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
52-
restore-keys: ${{ runner.os }}-${{ matrix.compiler-nix-name }}-
56+
key: ${{ env.CABAL_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.compiler-nix-name }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
57+
restore-keys: ${{ env.CABAL_CACHE_VERSION }}-${{ runner.os }}-${{ matrix.compiler-nix-name }}-
5358
- name: cabal update
5459
run: cabal update
5560
- name: cabal build dependencies

CONTRIBUTING.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ If this fails to build, it may also be necessary to update haskell.nix::
177177

178178
nix flake lock --update-input haskellNix
179179

180+
Increment ``CABAL_CACHE_VERSION`` in ``.github/workflows/haskell.yml``::
181+
182+
env:
183+
# Increment this value to "invalidate" the cabal cache. Be sure to do this
184+
# after updating dependencies (Hackage or chap)
185+
CABAL_CACHE_VERSION: 2
186+
180187
From the Cardano Haskell Package repository
181188
-------------------------------------------
182189

@@ -215,6 +222,13 @@ In rare cases, it may also be necessary to update haskell.nix::
215222

216223
nix flake lock --update-input haskellNix
217224

225+
Increment ``CABAL_CACHE_VERSION`` in ``.github/workflows/haskell.yml``::
226+
227+
env:
228+
# Increment this value to "invalidate" the cabal cache. Be sure to do this
229+
# after updating dependencies (Hackage or chap)
230+
CABAL_CACHE_VERSION: 2
231+
218232
Using unreleased versions of dependencies
219233
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220234

0 commit comments

Comments
 (0)