Skip to content

Commit 5846852

Browse files
committed
Use step outputs for cache key
1 parent a8becda commit 5846852

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/flags.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV
8787
8888
- name: Form the package list ('cabal.project.freeze')
89-
continue-on-error: true
89+
id: compute-cache-key
9090
run: |
9191
cabal v2-freeze && \
9292
echo "" && \
@@ -95,6 +95,7 @@ jobs:
9595
cat 'cabal.project.freeze' && \
9696
echo "" || \
9797
echo 'WARNING: Could not produce the `freeze`.'
98+
echo ::set-output name=value::${{ hashFiles('cabal.project.freeze') }}
9899
99100
- name: Hackage sources cache
100101
uses: actions/cache@v2
@@ -112,7 +113,7 @@ jobs:
112113
cache-name: compiled-deps
113114
with:
114115
path: ${{ steps.HaskEnvSetup.outputs.cabal-store }}
115-
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project.freeze') }}
116+
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ steps.compute-cache-key.outputs.value }}
116117
restore-keys: |
117118
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-
118119
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-

0 commit comments

Comments
 (0)