Skip to content

Commit 31b4e49

Browse files
authored
Merge pull request #3993 from AkihiroSuda/lima-actions
CI: simplify setting up Lima
2 parents dbbf636 + f19eb5a commit 31b4e49

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
@@ -443,31 +443,12 @@ jobs:
443443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
444444
with:
445445
fetch-depth: 1
446-
- name: "Install QEMU"
447-
run: |
448-
set -eux
449-
sudo apt-get update -qq
450-
sudo apt-get install -qq --no-install-recommends ovmf qemu-system-x86 qemu-utils
451-
sudo modprobe kvm
452-
# `sudo usermod -aG kvm $(whoami)` does not take an effect on GHA
453-
sudo chown $(whoami) /dev/kvm
454-
- name: "Install Lima"
455-
env:
456-
GITHUB_TOKEN: ${{ github.token }} # required by `gh attestation verify`
457-
run: |
458-
set -eux
459-
LIMA_VERSION=$(curl -fsSL https://api.github.com/repos/lima-vm/lima/releases/latest | jq -r .tag_name)
460-
FILE="lima-${LIMA_VERSION:1}-Linux-x86_64.tar.gz"
461-
curl -fOSL https://github.com/lima-vm/lima/releases/download/${LIMA_VERSION}/${FILE}
462-
gh attestation verify --owner=lima-vm "${FILE}"
463-
sudo tar Cxzf /usr/local "${FILE}"
464-
rm -f "${FILE}"
465-
# Export LIMA_VERSION For the GHA cache key
466-
echo "LIMA_VERSION=${LIMA_VERSION}" >>$GITHUB_ENV
446+
- uses: lima-vm/lima-actions/setup@be564a1408f84557d067b099a475652288074b2e # v1.0.0
447+
id: lima-actions-setup
467448
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
468449
with:
469450
path: ~/.cache/lima
470-
key: lima-${{ env.LIMA_VERSION }}
451+
key: lima-${{ steps.lima-actions-setup.outputs.version }}
471452
- name: "Start the guest VM"
472453
run: |
473454
set -eux

0 commit comments

Comments
 (0)