Skip to content

Commit a1050c7

Browse files
committed
setup_cache_for_template: support url in template parameter
1 parent 2e32b6f commit a1050c7

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/actions/setup_cache_for_template/action.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ runs:
2727
set -eux
2828
arch="${{ inputs.arch }}"
2929
template="${{ inputs.template }}"
30-
test -f "$template" || exit 1
30+
case "$template" in
31+
https://*)
32+
tmp_yaml=$(mktemp -d)/template.yaml
33+
curl -sSLf "$template" > $tmp_yaml || exit 1
34+
template=$tmp_yaml
35+
;;
36+
*)
37+
test -f "$template" || exit 1
38+
;;
39+
esac
3140
3241
# detect arch from template if not provided
3342
arch="${arch:-$(yq '.arch // ""' "$template")}"

.github/workflows/test.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,10 @@ jobs:
367367
- uses: actions/setup-go@v5
368368
with:
369369
go-version: 1.22.x
370-
- name: Cache ~/Library/Caches/lima/download
371-
uses: actions/cache@v4
370+
- name: Cache image used by ${{ matrix.oldver }}/examples/ubuntu-lts.yaml
371+
uses: ./.github/actions/setup_cache_for_template
372372
with:
373-
path: ~/Library/Caches/lima/download
374-
key: ${{ runner.os }}-upgrade-${{ matrix.oldver }}
373+
template: https://raw.githubusercontent.com/lima-vm/lima/${{ matrix.oldver }}/examples/ubuntu-lts.yaml
375374
- name: Install test dependencies
376375
run: brew install qemu bash coreutils
377376
- name: Test

0 commit comments

Comments
 (0)