41
41
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
42
42
name : Restore Cached Dependencies
43
43
keys :
44
- - cci-demo-haskell-v1-{{ checksum "package.yaml" }}-{{ checksum "stack.yaml" }}
44
+ - cci-demo-haskell-v1-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
45
+ - cci-demo-haskell-v1-{{ checksum "stack.yaml" }}
45
46
- run :
46
47
name : Resolve/Update Dependencies
47
48
command : stack setup
53
54
command : stack install
54
55
- save_cache :
55
56
name : Cache Dependencies
56
- key : cci-demo-haskell-v1-{{ checksum "package .yaml" }}-{{ checksum "stack .yaml" }}
57
+ key : cci-demo-haskell-v1-{{ checksum "stack .yaml" }}-{{ checksum "package .yaml" }}
57
58
paths :
58
59
- " /root/.stack"
59
60
- " .stack-work"
@@ -114,13 +115,14 @@ compiler as specified in the `stack.yaml` config.
114
115
- restore_cache:
115
116
name: Restore Cached Dependencies
116
117
keys:
117
- - cci-demo-haskell-v1-{{ checksum "package.yaml" }}-{{ checksum "stack.yaml" }}
118
+ - cci-demo-haskell-v1-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
119
+ - cci-demo-haskell-v1-{{ checksum "stack.yaml" }}
118
120
- run:
119
121
name: Resolve/Update Dependencies
120
122
command: stack setup
121
123
- save_cache:
122
124
name: Cache Dependencies
123
- key: cci-demo-haskell-v1-{{ checksum "package .yaml" }}-{{ checksum "stack .yaml" }}
125
+ key: cci-demo-haskell-v1-{{ checksum "stack .yaml" }}-{{ checksum "package .yaml" }}
124
126
paths:
125
127
- ~/.stack
126
128
- ~/.stack-work
@@ -130,7 +132,9 @@ compiler as specified in the `stack.yaml` config.
130
132
Note : It's also possible to use a `cabal` build file for caching dependencies.
131
133
` stack` , however, is commonly recommended, especially for those new to the Haskell ecosystem. Because this
132
134
demo app leverages `stack.yaml` and `package.yaml`, we use these two files as the
133
- cache key for our dependencies. You can read more about the differences between
135
+ cache key for our dependencies. `package.yaml` is more often updated than `stack.yaml` so that two keys are
136
+ used to restore the cache.
137
+ You can read more about the differences between
134
138
` stack` and `cabal` on [The Haskell Tool Stack docs](https://docs.haskellstack.org/en/stable/stack_yaml_vs_cabal_package_file/).
135
139
136
140
Finally, we can run our application build commands. We'll run our tests first
0 commit comments