Skip to content

Commit 9a6e3f6

Browse files
committed
CI: add colima compatibility test
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 9f1aaf9 commit 9a6e3f6

File tree

2 files changed

+44
-13
lines changed

2 files changed

+44
-13
lines changed

.cirrus.yml

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# are too slow and flaky, and Linux instances of GHA do not support KVM.
44

55
# yamllint disable rule:line-length
6-
task:
6+
7+
8+
common_template: &common_template
79
timeout_in: 30m
810
# We can't use macOS instances of Cirrus because of lack of support for nested VMs.
911
# (sysctl machdep.cpu.features lacks "VMX" flag)
@@ -14,16 +16,6 @@ task:
1416
memory: 8G
1517
env:
1618
DEBIAN_FRONTEND: noninteractive
17-
# yamllint disable rule:key-duplicates
18-
matrix:
19-
# We only test "Tier 1" yamls. See examples/README.md for the list of the "Tier 1" yamls.
20-
# default.yaml and vmnet.yaml are tested on GHA macOS.
21-
EXAMPLE: alpine.yaml
22-
EXAMPLE: debian.yaml
23-
EXAMPLE: fedora.yaml
24-
EXAMPLE: archlinux.yaml
25-
EXAMPLE: opensuse.yaml
26-
EXAMPLE: experimental/net-user-v2.yaml
2719
info_script:
2820
- uname -a
2921
- df -T
@@ -40,8 +32,39 @@ task:
4032
prepare_user_script:
4133
- groupadd -g $(stat -c '%g' /dev/kvm) kvm
4234
- useradd -m -G kvm testuser
35+
36+
task:
37+
<<: *common_template
38+
env:
39+
# yamllint disable rule:key-duplicates
40+
matrix:
41+
# We only test "Tier 1" yamls. See examples/README.md for the list of the "Tier 1" yamls.
42+
# default.yaml and vmnet.yaml are tested on GHA macOS.
43+
TEMPLATE: alpine.yaml
44+
TEMPLATE: debian.yaml
45+
TEMPLATE: fedora.yaml
46+
TEMPLATE: archlinux.yaml
47+
TEMPLATE: opensuse.yaml
48+
TEMPLATE: experimental/net-user-v2.yaml
49+
lima_cache:
50+
fingerprint_script: uname -s ; cat examples/$TEMPLATE
51+
folder: /home/testuser/.cache/lima
52+
lima_cache_fix_perm_script: chown -R testuser.testuser /home/testuser
53+
test_script: sudo -iu testuser $(pwd)/hack/test-example.sh $(pwd)/examples/$TEMPLATE
54+
55+
colima_task:
56+
<<: *common_template
57+
colima_install_deps_script:
58+
- curl -fOSL https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce-cli_24.0.1-1~ubuntu.22.04~jammy_amd64.deb
59+
- dpkg -i docker-ce-cli_24.0.1-1~ubuntu.22.04~jammy_amd64.deb
60+
colima_install_script:
61+
- git clone https://github.com/abiosoft/colima
62+
- cd colima
63+
- git checkout v0.5.5
64+
- make
65+
- make install
4366
lima_cache:
44-
fingerprint_script: uname -s ; cat examples/$EXAMPLE
67+
fingerprint_script: uname -s ; colima version
4568
folder: /home/testuser/.cache/lima
4669
lima_cache_fix_perm_script: chown -R testuser.testuser /home/testuser
47-
test_script: sudo -iu testuser $(pwd)/hack/test-example.sh $(pwd)/examples/$EXAMPLE
70+
test_script: sudo -iu testuser $(pwd)/hack/test-colima.sh

hack/test-colima.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -eux -o pipefail
3+
4+
colima start
5+
6+
docker run --rm hello-world
7+
8+
colima stop

0 commit comments

Comments
 (0)