Skip to content

Commit

Permalink
Add macOS CI
Browse files Browse the repository at this point in the history
Add basic tests for drenv skipping the tests requiring a test cluster
which we cannot use yet.

Github provides Intel based macOS runners supporting nested
virtualization. We can start a lima vm but it always get stuck waiting
for ssh connection to the guest. We can try to fix this later, but for
now we can run all the test that do not require a test cluster by
skipping the tests.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Sep 20, 2024
1 parent 763efc4 commit 0e5ed3f
Showing 1 changed file with 66 additions and 8 deletions.
74 changes: 66 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,72 @@ jobs:
run: make clean
working-directory: test

ramenctl-test:
name: ramenctl tests
runs-on: ubuntu-22.04
drenv-macos:
name: drenv
strategy:
matrix:
os:
# arm64, 3 cpus (M1), 7 GiB RAM, no nested virtalization.
- macos-14
python-version:
- "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout ramen
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: Enable coverage for child processes
run: cp coverage.pth $(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')

- 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

- name: Run tests
# We cannot run the test cluster on macOS.
run: make unit-test
working-directory: test

- name: Report test coverage
run: make coverage
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:
# arm64, 3 cpus (M1), 7 GiB RAM, no nested virtalization.
- os: macos-14
python-version: "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -198,7 +256,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 0e5ed3f

Please sign in to comment.