Skip to content

Commit 5949e3f

Browse files
committed
CI "Check Field Syntax Reference": correct cache key
1 parent ba6f6ff commit 5949e3f

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/quick-jobs.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,32 @@ jobs:
113113
buildinfo:
114114
name: Check Field Syntax Reference
115115
runs-on: ubuntu-latest
116+
env:
117+
cabal_build: cabal build buildinfo-reference-generator
116118
steps:
117-
- uses: actions/cache@v4
118-
with:
119-
path: ~/.local/state/cabal
120-
key: linux-store-buildinfo-doc-diff
121119
- name: Update Hackage index
122120
run: cabal v2-update
123121
- uses: actions/checkout@v4
122+
- name: Generate build plan for correct cache key
123+
run: ${{ env.cabal_build }} --dry-run
124+
- name: Restore cached dependencies
125+
uses: actions/cache/restore@v4
126+
id: cache
127+
with:
128+
path: ~/.local/state/cabal
129+
key: linux-store-buildinfo-doc-diff-${{ hashfiles('dist-newstyle/cache/plan.json') }}
130+
restore-keys: linux-store-buildinfo-doc-diff
131+
- name: Build buildinfo-reference-generator
132+
run: ${{ env.cabal_build }}
124133
- name: Are buildinfo docs up to date?
125134
run: make doc/buildinfo-fields-reference.rst
135+
- name: Cache dependencies
136+
uses: actions/cache/save@v4
137+
if: always() && steps.cache.outputs.cache-hit != 'true'
138+
with:
139+
path: ~/.local/state/cabal
140+
key: ${{ steps.cache.outputs.cache-primary-key }}
141+
126142
release-project:
127143
name: Check Release Project
128144
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)