@@ -158,12 +158,6 @@ jobs:
158
158
- uses : actions/setup-go@v5
159
159
with :
160
160
go-version : 1.23.x
161
- - name : Cache ~/Library/Caches/lima/download
162
- uses : actions/cache@v4
163
- with :
164
- path : ~/Library/Caches/lima/download
165
- # hashFiles do not seem to support symlinks
166
- key : ${{ runner.os }}-${{ hashFiles('templates/default.yaml') }}
167
161
- name : Unit tests
168
162
run : go test -v ./...
169
163
- name : Make
@@ -183,11 +177,15 @@ jobs:
183
177
# GitHub runners seem to have lima installed by brew already; we don't want/need it
184
178
time brew uninstall --ignore-dependencies lima colima
185
179
time brew install qemu bash coreutils curl jq
186
- - name : " Show cache"
187
- run : ./hack/debug-cache.sh
188
180
- name : " Inject `no_timer_check` to kernel cmdline"
189
181
# workaround to https://github.com/lima-vm/lima/issues/84
190
182
run : ./hack/inject-cmdline-to-template.sh templates/default.yaml no_timer_check
183
+ - name : Cache image used by default.yaml
184
+ uses : ./.github/actions/setup_cache_for_template
185
+ with :
186
+ template : templates/default.yaml
187
+ - name : " Show cache"
188
+ run : ./hack/debug-cache.sh
191
189
- name : " Test default.yaml"
192
190
uses : nick-invision/retry@v3
193
191
with :
@@ -231,19 +229,14 @@ jobs:
231
229
- uses : actions/setup-go@v5
232
230
with :
233
231
go-version : 1.23.x
234
- - id : path_for_hashFiles
235
- # It seems that `hashFiles` cannot use `..` as a path component, so generate a normalized path here.
236
- run : echo "NORMALIZED=$(realpath --relative-to=$PWD examples/${{ matrix.template }})" >> "$GITHUB_OUTPUT"
237
- - uses : actions/cache@v4
238
- with :
239
- path : ~/.cache/lima/download
240
- # hashFiles do not seem to support symlinks
241
- # TODO: more fine-grained cache
242
- key : ${{ runner.os }}-${{ hashFiles(steps.path_for_hashFiles.outputs.NORMALIZED) }}
243
232
- name : Make
244
233
run : make
245
234
- name : Install
246
235
run : sudo make install
236
+ - name : Cache image used by templates/${{ matrix.template }}
237
+ uses : ./.github/actions/setup_cache_for_template
238
+ with :
239
+ template : templates/${{ matrix.template }}
247
240
- name : Install test dependencies
248
241
run : |
249
242
sudo apt-get update
@@ -332,16 +325,17 @@ jobs:
332
325
- uses : actions/setup-go@v5
333
326
with :
334
327
go-version : 1.23.x
335
- - name : Cache ~/Library/Caches/lima/download
336
- uses : actions/cache@v4
337
- with :
338
- path : ~/Library/Caches/lima/download
339
- # hashFiles do not seem to support symlinks
340
- key : ${{ runner.os }}-${{ hashFiles('examples/vmnet.yaml') }}
341
328
- name : Make
342
329
run : make
343
330
- name : Install
344
331
run : make install
332
+ - name : " Inject `no_timer_check` to kernel cmdline"
333
+ # workaround to https://github.com/lima-vm/lima/issues/84
334
+ run : ./hack/inject-cmdline-to-template.sh templates/vmnet.yaml no_timer_check
335
+ - name : Cache image used by vmnet.yaml
336
+ uses : ./.github/actions/setup_cache_for_template
337
+ with :
338
+ template : templates/vmnet.yaml
345
339
- name : Install test dependencies
346
340
run : brew install qemu bash coreutils iperf3
347
341
- name : Install socket_vmnet
@@ -360,9 +354,6 @@ jobs:
360
354
- name : Unit test (pkg/networks) with socket_vmnet
361
355
# Set -count=1 to disable cache
362
356
run : go test -v -count=1 ./pkg/networks/...
363
- - name : " Inject `no_timer_check` to kernel cmdline"
364
- # workaround to https://github.com/lima-vm/lima/issues/84
365
- run : ./hack/inject-cmdline-to-template.sh templates/vmnet.yaml no_timer_check
366
357
- name : Test socket_vmnet
367
358
uses : nick-invision/retry@v3
368
359
with :
@@ -387,11 +378,10 @@ jobs:
387
378
- uses : actions/setup-go@v5
388
379
with :
389
380
go-version : 1.23.x
390
- - name : Cache ~/Library/Caches/lima/download
391
- uses : actions/cache@v4
381
+ - name : Cache image used by ${{ matrix.oldver }}/examples/ubuntu-lts.yaml
382
+ uses : ./.github/ actions/setup_cache_for_template
392
383
with :
393
- path : ~/Library/Caches/lima/download
394
- key : ${{ runner.os }}-upgrade-${{ matrix.oldver }}
384
+ template : https://raw.githubusercontent.com/lima-vm/lima/${{ matrix.oldver }}/examples/ubuntu-lts.yaml
395
385
- name : Install test dependencies
396
386
run : brew install qemu bash coreutils
397
387
- name : Test
@@ -422,19 +412,14 @@ jobs:
422
412
- uses : actions/setup-go@v5
423
413
with :
424
414
go-version : 1.23.x
425
- - id : path_for_hashFiles
426
- # It seems that `hashFiles` cannot use `..` as a path component, so generate a normalized path here.
427
- run : echo "NORMALIZED=$(realpath examples/${{ matrix.template }})" >> "$GITHUB_OUTPUT"
428
- - name : Cache ~/Library/Caches/lima/download
429
- uses : actions/cache@v4
430
- with :
431
- path : ~/Library/Caches/lima/download
432
- # hashFiles do not seem to support symlinks
433
- key : ${{ runner.os }}-${{ hashFiles(steps.path_for_hashFiles.outputs.NORMALIZED) }}
434
415
- name : Make
435
416
run : make
436
417
- name : Install
437
418
run : make install
419
+ - name : Cache image used by templates/${{ matrix.template }}
420
+ uses : ./.github/actions/setup_cache_for_template
421
+ with :
422
+ template : templates/${{ matrix.template }}
438
423
- name : Install test dependencies
439
424
run : brew install bash coreutils jq
440
425
- name : Uninstall qemu
0 commit comments