-
Notifications
You must be signed in to change notification settings - Fork 17
92 lines (90 loc) · 3.15 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: test
on:
push:
branches:
- master
- 'release/**'
pull_request:
jobs:
integration:
name: Integration tests
strategy:
matrix:
# macos-13-xl is used as macos-13 seems too flaky
platform: [macos-11, macos-12, macos-13-xl]
runs-on: ${{ matrix.platform }}
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Show host info
run: |
uname -a
sw_vers
ifconfig
- name: Make Install (x86_64)
run: |
# compile for x86_64
sudo make PREFIX=/opt/socket_vmnet install
if file /opt/socket_vmnet/bin/* | grep -q arm64 ; then false ; fi
- name: Cleanup
run: |
sudo make clean
- name: Make Install (arm64)
run: |
# cross-compile for arm64
# Skip installing launchd services
sudo make PREFIX=/opt/socket_vmnet.arm64 ARCH=arm64 install.bin install.doc
if file /opt/socket_vmnet.arm64/bin/* | grep -q x86_64 ; then false ; fi
- name: Print launchd status (shared mode)
run: launchctl print system/io.github.lima-vm.socket_vmnet
- name: Install test dependencies
run: brew install qemu bash coreutils
- name: Test (shared mode)
run: ./test/test.sh /var/run/socket_vmnet
# Bridged mode cannot be tested on GHA
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Install Lima
run: |
git clone https://github.com/lima-vm/lima
cd lima
git checkout v0.17.0
make
sudo make install
limactl sudoers >etc_sudoers.d_lima
sudo install -o root etc_sudoers.d_lima "/private/etc/sudoers.d/lima"
- name: Install the dependencies for the Lima integration test
run: brew install iperf3 jq
- name: "Lima: vm1: prepare"
run: |
limactl start --name=vm1 --set '.cpus=1 | .memory = "1GiB"' --tty=false template://vmnet
limactl shell vm1 ip a
- name: "Lima: vm1: set up iperf3"
run: |
limactl shell vm1 sudo DEBIAN_FRONTEND=noninteractive apt-get install -y iperf3
limactl shell vm1 systemd-run --user --unit=iperf3 iperf3 -s
- name: "Lima: vm1: get the IP"
run: |
limactl shell vm1 ip -4 -json addr show dev lima0 | jq -r .[0].addr_info[0].local | tee /tmp/vm1_iP
- name: "Lima: vm1: iperf3 (host -> vm1)"
run: |
iperf3 -c "$(cat /tmp/vm1_ip)"
- name: "Lima: vm1: debug"
if: failure()
run: tail -n500 ~/.lima/vm1/*.log
- name: "Lima: vm2: prepare"
run: |
limactl start --name=vm2 --set '.cpus=1 | .memory = "1GiB"' --tty=false template://vmnet
limactl shell vm2 ip a
- name: "Lima: vm2: set up iperf3"
run: |
limactl shell vm2 sudo DEBIAN_FRONTEND=noninteractive apt-get install -y iperf3
- name: "Lima: vm2: iperf3 (vm2 -> vm1)"
run: |
limactl shell vm2 iperf3 -c "$(cat /tmp/vm1_ip)"
- name: "Lima: vm2: debug"
if: failure()
run: tail -n500 ~/.lima/vm2/*.log