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. Build and install lima and socket_vmnet, and add the
missing steps to start the test clusters and run the tests.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Sep 20, 2024
1 parent 944a2cc commit f33d090
Showing 1 changed file with 62 additions and 4 deletions.
66 changes: 62 additions & 4 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: "1.23" # used by lima-ci

- 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,15 +265,32 @@ jobs:
run: make black
working-directory: test

- name: Start test cluster
run: make cluster
working-directory: test
timeout-minutes: 5

- name: Show logs on error
if: failure()
run: |
export DIR=$(limactl list --format '{{.Dir}}')
# Don't fail entire step if one log is missing.
cat $DIR/ha.stdout.log || true
cat $DIR/ha.stderr.log || true
cat $DIR/copied-from-guest/kubectl.yaml || true
- name: Run tests
# We cannot run the test cluster on macOS.
run: make unit-test
run: make test
working-directory: test

- name: Report test coverage
run: make coverage
working-directory: test

- name: Clean up
run: make clean
working-directory: test

ramenctl:
name: ramenctl
strategy:
Expand Down

0 comments on commit f33d090

Please sign in to comment.