Skip to content

Commit 3d0ec0f

Browse files
committed
CI: see if wsl2 works
Signed-off-by: Akihiro Suda <[email protected]>
1 parent e701cac commit 3d0ec0f

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

.github/workflows/test.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,34 @@ jobs:
6868

6969
windows:
7070
name: "Windows tests"
71-
runs-on: windows-2022
71+
runs-on: windows-2022-8-cores
7272
timeout-minutes: 30
73+
defaults:
74+
run:
75+
shell: bash
7376
steps:
77+
- name: Enable WSL2
78+
run: |
79+
set -eux -o pipefail
80+
wsl --status || true
81+
wsl --set-default-version 2
82+
wsl --update
83+
wsl --status
84+
wsl --list --online
85+
- name: Install WSL2 distro
86+
timeout-minutes: 3
87+
run: |
88+
set -eux -o pipefail
89+
whoami
90+
# FIXME: At least one distro has to be installed here,
91+
# otherwise `wsl --list --verbose` (called from Lima) fails:
92+
# https://github.com/lima-vm/lima/pull/1826#issuecomment-1729993334
93+
# The distro image itself is not consumed by Lima.
94+
# ------------------------------------------------------------------
95+
# Ubuntu-22.04: gets stuck in some infinite loop during adduser
96+
# OracleLinux_9_1: almostly silently fails, and just prints "Usage: adduser [options] LOGIN"
97+
wsl --install -d openSUSE-Leap-15.5
98+
wsl --list --verbose
7499
- uses: actions/checkout@v4
75100
with:
76101
fetch-depth: 1
@@ -81,6 +106,14 @@ jobs:
81106
run: go test -v ./...
82107
- name: Make
83108
run: make
109+
- name: Install
110+
run: make install
111+
# FIXME: installing to /usr/local/ doesn't seem correct for Windows
112+
- name: Test
113+
run: |
114+
set -eux -o pipefail
115+
export PATH=/usr/local/bin:$PATH
116+
./hack/test-templates.sh ./templates/experimental/wsl2.yaml
84117
85118
integration:
86119
name: Integration tests

0 commit comments

Comments
 (0)