Skip to content

Commit

Permalink
Add macOS CI
Browse files Browse the repository at this point in the history
Github provides macOS M1 based runners[1]. These are good enough to run
one test cluster for testing drenv itself. Unfortunately the runners are
virtualized and nested virtualization is not supported. If we try to
start a lima vm we fail with:

    Error Domain=VZErrorDomain Code=2 Description=\"Invalid virtual
    machine configuration.  Virtualization is not available on this
    hardware.\"

We can run drenv and ramenctl linters and test that do not require a
test cluster. This change add a job on macos-14[1], running the flake8,
pylint, and black. This will help developers to validate changes on
macOS without access to macOS machine.

More work is needed to filter out the test that require a test cluster.

[1] https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Sep 18, 2024
1 parent 1bb6b38 commit d551309
Showing 1 changed file with 54 additions and 8 deletions.
62 changes: 54 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ env:
IMAGE_REGISTRY: "quay.io"
IMAGE_TAG: "ci"
DOCKERCMD: "podman"
DRIVER: "container"
defaults:
run:
shell: bash
Expand Down Expand Up @@ -109,17 +108,21 @@ jobs:
- name: Run unit tests
run: make test

drenv-test:
name: drenv tests
runs-on: ubuntu-22.04
drenv-linux:
name: drenv
strategy:
matrix:
os:
- ubuntu-22.04
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13-dev"
runs-on: ${{ matrix.os }}
env:
DRIVER: "container"
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down Expand Up @@ -178,17 +181,60 @@ jobs:
run: make clean
working-directory: test

ramenctl-test:
name: ramenctl tests
runs-on: ubuntu-22.04
drenv-macos:
name: drenv
strategy:
matrix:
os:
- macos-14
python-version:
- "3.12"
runs-on: ${{ matrix.os }}
env:
DRIVER: "vm"
steps:
- name: Checkout source
uses: actions/checkout@v4

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

- name: Install python packages
run: pip install -r requirements.txt

- name: Install drenv
run: pip install -e test

- name: Run flake8
run: make flake8
working-directory: test

- name: Run pylint
run: make pylint
working-directory: test

- name: Run black
run: make black
working-directory: test

ramenctl:
name: ramenctl
strategy:
matrix:
os:
- ubuntu-22.04
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13-dev"
include:
- os: macos-14
python-version: "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -198,7 +244,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install tools
- name: Install python packages
run: pip install -r requirements.txt

- name: Install drenv
Expand Down

0 comments on commit d551309

Please sign in to comment.