Skip to content

Commit dc7ae41

Browse files
committed
CI: add .cirrus.yml
Signed-off-by: Akihiro Suda <[email protected]>
1 parent d4fe56b commit dc7ae41

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

.cirrus.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
# We use Cirrus for most of integration tests, because macOS instances of GHA
3+
# are too slow and flaky, and Linux instances of GHA do not support KVM.
4+
5+
# yamllint disable rule:line-length
6+
task:
7+
timeout_in: 30m
8+
# We can't use macOS instances of Cirrus because of lack of support for nested VMs.
9+
# (sysctl machdep.cpu.features lacks "VMX" flag)
10+
container:
11+
image: ubuntu:21.04
12+
kvm: true
13+
cpu: 2
14+
memory: 8G
15+
env:
16+
DEBIAN_FRONTEND: noninteractive
17+
# yamllint disable rule:key-duplicates
18+
matrix:
19+
# default.yaml is tested on GHA macOS, so we skip default.yaml here
20+
EXAMPLE: alpine.yaml
21+
EXAMPLE: debian.yaml
22+
EXAMPLE: fedora.yaml
23+
EXAMPLE: archlinux.yaml
24+
EXAMPLE: opensuse.yaml
25+
info_script:
26+
- uname -a
27+
- df -T
28+
- ls -l /dev/kvm
29+
- cat /proc/cpuinfo
30+
install_deps_script:
31+
- apt-get update
32+
- apt-get install -y --no-install-recommends ca-certificates curl git golang openssh-client make ovmf sudo qemu-system-x86 qemu-utils
33+
go_cache:
34+
fingerprint_script: uname -s ; cat go.sum
35+
folder: $GOPATH/pkg/mod
36+
build_script: make
37+
install_script: make install
38+
prepare_user_script:
39+
- groupadd -g $(stat -c '%g' /dev/kvm) kvm
40+
- useradd -m -G kvm testuser
41+
lima_cache:
42+
fingerprint_script: uname -s ; cat examples/$EXAMPLE
43+
folder: /home/testuser/.cache/lima
44+
test_script: sudo -iu testuser $(pwd)/hack/test-example.sh $(pwd)/examples/$EXAMPLE

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ jobs:
8181
timeout-minutes: 40
8282
strategy:
8383
matrix:
84-
example: [default.yaml, alpine.yaml, debian.yaml, fedora.yaml, archlinux.yaml, opensuse.yaml]
84+
# GHA macOS is slow and flaky, so we only test "default.yaml" here.
85+
# Other yamls are tested on Linux instances of Cirrus.
86+
example: [default.yaml]
8587
steps:
8688
- uses: actions/setup-go@v2
8789
with:

0 commit comments

Comments
 (0)