File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,22 @@ jobs:
51
51
stack-no-global : true
52
52
53
53
- name : Configure the build
54
+ id : configure
54
55
run : |
55
- echo "with key: ${{ runner.os }}-ghc -${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}"
56
+ echo "with key: ${{ runner.os }}-lts -${{ matrix.stack.lts }}"
56
57
57
58
stack config set resolver lts-${{ matrix.stack.lts }}
58
59
stack build --dry-run
59
60
# The last step generates dist-newstyle/cache/plan.json for the cache key.
60
61
62
+ outputs :
63
+ cache-key : ${{ runner.os }}-lts-${{ matrix.stack.lts }}
64
+
61
65
- name : Restore cached dependencies
62
66
uses : actions/cache/restore@v3
63
67
id : cache
64
68
env :
65
- key : ${{ runner.os }}-ghc-${{ steps.setup .outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
69
+ key : ${{ steps.configure .outputs.cache-key }}
66
70
67
71
with :
68
72
path : ${{ steps.setup.outputs.stack-root }}
72
76
- name : Install dependencies
73
77
run : stack build --only-dependencies
74
78
75
- # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
79
+ # Cache dependencies already here, so that we do not have to rebuild them
80
+ # should the subsequent steps fail.
76
81
- name : Save cached dependencies
77
82
uses : actions/cache/save@v3
78
83
# Caches are immutable, trying to save with the same key would error.
You can’t perform that action at this time.
0 commit comments