Skip to content

Commit f19eb5a

Browse files
committed
CI: simplify setting up Lima
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 2f9a4f6 commit f19eb5a

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -437,31 +437,12 @@ jobs:
437437
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
438438
with:
439439
fetch-depth: 1
440-
- name: "Install QEMU"
441-
run: |
442-
set -eux
443-
sudo apt-get update -qq
444-
sudo apt-get install -qq --no-install-recommends ovmf qemu-system-x86 qemu-utils
445-
sudo modprobe kvm
446-
# `sudo usermod -aG kvm $(whoami)` does not take an effect on GHA
447-
sudo chown $(whoami) /dev/kvm
448-
- name: "Install Lima"
449-
env:
450-
GITHUB_TOKEN: ${{ github.token }} # required by `gh attestation verify`
451-
run: |
452-
set -eux
453-
LIMA_VERSION=$(curl -fsSL https://api.github.com/repos/lima-vm/lima/releases/latest | jq -r .tag_name)
454-
FILE="lima-${LIMA_VERSION:1}-Linux-x86_64.tar.gz"
455-
curl -fOSL https://github.com/lima-vm/lima/releases/download/${LIMA_VERSION}/${FILE}
456-
gh attestation verify --owner=lima-vm "${FILE}"
457-
sudo tar Cxzf /usr/local "${FILE}"
458-
rm -f "${FILE}"
459-
# Export LIMA_VERSION For the GHA cache key
460-
echo "LIMA_VERSION=${LIMA_VERSION}" >>$GITHUB_ENV
440+
- uses: lima-vm/lima-actions/setup@be564a1408f84557d067b099a475652288074b2e # v1.0.0
441+
id: lima-actions-setup
461442
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
462443
with:
463444
path: ~/.cache/lima
464-
key: lima-${{ env.LIMA_VERSION }}
445+
key: lima-${{ steps.lima-actions-setup.outputs.version }}
465446
- name: "Start the guest VM"
466447
run: |
467448
set -eux

0 commit comments

Comments
 (0)