Skip to content

Commit db2c41a

Browse files
authored
Merge pull request #3475 from arixmkii/qemu-win-ci
Add QEMU on Windows to CI
2 parents e88f2da + 9f7b9a8 commit db2c41a

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ jobs:
151151
run: sudo make uninstall
152152

153153
windows:
154-
name: "Windows tests"
155-
runs-on: windows-2022-8-cores
154+
name: "Windows tests (WSL2)"
155+
runs-on: windows-2025-8-cores
156156
timeout-minutes: 30
157157
steps:
158158
- name: Enable WSL2
@@ -205,6 +205,40 @@ jobs:
205205
$env:_LIMA_WINDOWS_EXTRA_PATH = 'C:\Program Files\Git\usr\bin'
206206
bash.exe -c "./hack/test-templates.sh templates/experimental/wsl2.yaml"
207207
208+
windows-qemu:
209+
name: "Windows tests (QEMU)"
210+
runs-on: windows-2025
211+
timeout-minutes: 30
212+
steps:
213+
- name: Set gitconfig
214+
run: |
215+
git config --global core.autocrlf false
216+
git config --global core.eol lf
217+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
218+
with:
219+
# To avoid "can't parse builtin Lima version" errors
220+
fetch-depth: 0
221+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
222+
with:
223+
go-version: 1.24.x
224+
- name: Unit tests
225+
run: go test -v ./...
226+
- name: Make
227+
run: make
228+
- name: Install QEMU
229+
run: |
230+
winget install --silent --accept-source-agreements --accept-package-agreements --disable-interactivity SoftwareFreedomConservancy.QEMU
231+
- name: Integration tests (QEMU, Windows host)
232+
run: |
233+
$env:PATH = "$pwd\_output\bin;" + 'C:\msys64\usr\bin;' + 'C:\Program Files\QEMU;' + $env:PATH
234+
pacman -Sy --noconfirm openbsd-netcat diffutils
235+
$env:MSYS2_ENV_CONV_EXCL = 'HOME_HOST;HOME_GUEST;_LIMA_WINDOWS_EXTRA_PATH'
236+
$env:HOME_HOST = $(cygpath.exe "$env:USERPROFILE")
237+
$env:HOME_GUEST = "$env:HOME_HOST"
238+
$env:LIMACTL_CREATE_ARGS = '--vm-type=qemu'
239+
$env:_LIMA_WINDOWS_EXTRA_PATH = 'C:\Program Files\Git\usr\bin'
240+
bash.exe -c "./hack/test-templates.sh templates/default.yaml"
241+
208242
qemu:
209243
name: "Integration tests (QEMU, macOS host)"
210244
runs-on: macos-15-large # Intel

hack/test-templates.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ declare -A CHECKS=(
6060
)
6161

6262
case "$NAME" in
63+
"default")
64+
# CI failure:
65+
# "[hostagent] failed to confirm whether /c/Users/runneradmin [remote] is successfully mounted"
66+
[ "${OS_HOST}" = "Msys" ] && CHECKS["mount-home"]=
67+
;;
6368
"alpine"*)
6469
WARNING "Alpine does not support systemd"
6570
CHECKS["systemd"]=

0 commit comments

Comments
 (0)