Skip to content

Commit

Permalink
Try to run lima vm in github actions
Browse files Browse the repository at this point in the history
On macos-13 runner we can run lima vm using the vz vm type using nested
virtualization. It does not work yet with drev, but lets try to run the
simplest possible VM.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Sep 20, 2024
1 parent d6bdad9 commit dbbf899
Showing 1 changed file with 52 additions and 8 deletions.
60 changes: 52 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,61 @@ jobs:
strategy:
matrix:
os:
# arm64, 3 cpus (M1), 7 GiB RAM, no nested virtalization.
- macos-14
# amd64, 4 cpus, 14 GiB RAM, nested virtalization
- macos-13
python-version:
- "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout ramen
uses: actions/checkout@v4

- name: Checkout lima
uses: actions/checkout@v4
with:
repository: lima-vm/lima
path: lima

- name: Checkout socket_vmnet
uses: actions/checkout@v4
with:
repository: lima-vm/socket_vmnet
path: socket_vmnet

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup go for lima
uses: actions/setup-go@v5
with:
go-version-file: lima/go.mod

- name: Install lima
run: |
cd lima
# Miniaml build is 3 times faster than full make..
make minimal
# But it adds only the default template, so lets fix it:
rm -rf _output/share/lima/templates
cp -aL examples _output/share/lima/templates
ln -sf templates _output/share/lima/examples
# And install
sudo make install
limactl --version
- name: Install socket_vmnet
run: |
cd socket_vmnet
make
sudo make install.bin
sudo make install.launchd
/opt/socket_vmnet/bin/socket_vmnet --version
- name: Install Homebrew packages
run: brew install kubectl

Expand All @@ -224,14 +265,17 @@ jobs:
run: make black
working-directory: test

- name: Run tests
# We cannot run the test cluster on macOS.
run: make unit-test
- name: Start lima vm
run: limactl start --tty=false --vm-type vz --plain template://default
working-directory: test

- name: Report test coverage
run: make coverage
working-directory: test
- name: Show logs on error
if: failure()
run: |
export DIR=$(limactl list --format '{{.Dir}}')
cat $DIR/ha.stdout.log
cat $DIR/ha.stderr.log
cat $DIR/copied-from-guest/kubectl.yaml || true
ramenctl:
name: ramenctl
Expand Down

0 comments on commit dbbf899

Please sign in to comment.