@@ -157,12 +157,10 @@ jobs:
157
157
- uses : actions/setup-go@v5
158
158
with :
159
159
go-version : 1.22.x
160
- - name : Cache ~/Library/Caches/lima/download
161
- uses : actions/cache@v4
160
+ - name : Cache image used by default.yaml
161
+ uses : ./.github/ actions/setup_cache_for_template
162
162
with :
163
- path : ~/Library/Caches/lima/download
164
- # hashFiles do not seem to support symlinks
165
- key : ${{ runner.os }}-${{ hashFiles('templates/default.yaml') }}
163
+ template : templates/default.yaml
166
164
- name : Unit tests
167
165
run : go test -v ./...
168
166
- name : Make
@@ -225,15 +223,14 @@ jobs:
225
223
- uses : actions/setup-go@v5
226
224
with :
227
225
go-version : 1.22.x
228
- - id : path_for_hashFiles
229
- # It seems that `hashFiles` cannot use `..` as a path component, so generate a normalized path here.
230
- run : echo "NORMALIZED=$(realpath --relative-to=$PWD examples/${{ matrix.template }})" >> "$GITHUB_OUTPUT"
231
- - uses : actions/cache@v4
226
+ - name : normalize template path
227
+ id : normalize_template_path
228
+ # `hashFiles` cannot use `..` as a path component, so generate a normalized path here.
229
+ run : echo "NORMALIZED=$(realpath templates/${{ matrix.template }})" >> "$GITHUB_OUTPUT"
230
+ - name : Cache image used by ${{ steps.normalize_template_path.outputs.NORMALIZED }}
231
+ uses : ./.github/actions/setup_cache_for_template
232
232
with :
233
- path : ~/.cache/lima/download
234
- # hashFiles do not seem to support symlinks
235
- # TODO: more fine-grained cache
236
- key : ${{ runner.os }}-${{ hashFiles(steps.path_for_hashFiles.outputs.NORMALIZED) }}
233
+ template : ${{ steps.normalize_template_path.outputs.NORMALIZED }}
237
234
- name : Make
238
235
run : make
239
236
- name : Install
@@ -322,12 +319,10 @@ jobs:
322
319
- uses : actions/setup-go@v5
323
320
with :
324
321
go-version : 1.22.x
325
- - name : Cache ~/Library/Caches/lima/download
326
- uses : actions/cache@v4
322
+ - name : Cache image used by vmnet.yaml
323
+ uses : ./.github/ actions/setup_cache_for_template
327
324
with :
328
- path : ~/Library/Caches/lima/download
329
- # hashFiles do not seem to support symlinks
330
- key : ${{ runner.os }}-${{ hashFiles('examples/vmnet.yaml') }}
325
+ template : templates/vmnet.yaml
331
326
- name : Make
332
327
run : make
333
328
- name : Install
@@ -404,15 +399,14 @@ jobs:
404
399
- uses : actions/setup-go@v5
405
400
with :
406
401
go-version : 1.22.x
407
- - id : path_for_hashFiles
408
- # It seems that `hashFiles` cannot use `..` as a path component, so generate a normalized path here.
409
- run : echo "NORMALIZED=$(realpath examples/${{ matrix.template }})" >> "$GITHUB_OUTPUT"
410
- - name : Cache ~/Library/Caches/lima/download
411
- uses : actions/cache@v4
402
+ - name : normalize template path
403
+ id : normalize_template_path
404
+ # `hashFiles` cannot use `..` as a path component, so generate a normalized path here.
405
+ run : echo "NORMALIZED=$(realpath templates/${{ matrix.template }})" >> "$GITHUB_OUTPUT"
406
+ - name : Cache image used by ${{ steps.normalize_template_path.outputs.NORMALIZED }}
407
+ uses : ./.github/actions/setup_cache_for_template
412
408
with :
413
- path : ~/Library/Caches/lima/download
414
- # hashFiles do not seem to support symlinks
415
- key : ${{ runner.os }}-${{ hashFiles(steps.path_for_hashFiles.outputs.NORMALIZED) }}
409
+ template : ${{ steps.normalize_template_path.outputs.NORMALIZED }}
416
410
- name : Make
417
411
run : make
418
412
- name : Install
0 commit comments