Skip to content

Commit

Permalink
Split ci.yaml to ramen.yaml and tools.yaml
Browse files Browse the repository at this point in the history
Split the long ci.yaml to 2 workflows:
- ramen.yaml: testing ramen code and building ramen images
- tools.yaml: testing the drenv and ramenctl tools

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs authored and raghavendra-talur committed Nov 21, 2024
1 parent 68da787 commit 8c333b2
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 170 deletions.
171 changes: 1 addition & 170 deletions .github/workflows/ci.yaml → .github/workflows/ramen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
# yamllint disable rule:line-length

name: CI
name: ramen

# This workflow will run when developer push a topic branch to their
# fork in github, minimizing noise for maintainers. This
Expand Down Expand Up @@ -108,175 +108,6 @@ jobs:
- name: Run unit tests
run: make test

drenv-linux:
name: drenv
strategy:
matrix:
os:
- ubuntu-22.04
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14-dev"
runs-on: ${{ matrix.os }}
env:
DRIVER: "container"
steps:
- name: Checkout source
uses: actions/checkout@v4

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

- name: Install minikube
run: |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube version
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install ./kubectl /usr/local/bin/
kubectl version --client --output=yaml
- name: Install tools
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: Start test cluster
run: make cluster
working-directory: test

- name: Run tests
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

drenv-macos:
name: drenv
strategy:
matrix:
os:
# arm64, 3 cpus (M1), 7 GiB RAM, no nested virtalization.
- macos-14
python-version:
- "3.13"
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 Homebrew packages
run: brew install kubectl

- 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.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14-dev"
include:
# arm64, 3 cpus (M1), 7 GiB RAM, no nested virtalization.
- os: macos-14
python-version: "3.13"
runs-on: ${{ matrix.os }}
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: ramenctl

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

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

build-image:
name: Build image
runs-on: ubuntu-20.04
Expand Down
191 changes: 191 additions & 0 deletions .github/workflows/tools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
# yamllint disable rule:line-length

name: tools

# This workflow will run when developer push a topic branch to their
# fork in github, minimizing noise for maintainers. This
# workflow also runs on nightly basis at 12:00 AM (00:00 UTC)

on: # yamllint disable-line rule:truthy
push:
pull_request:
schedule:
- cron: '0 0 * * *'

defaults:
run:
shell: bash

jobs:
drenv-linux:
name: drenv
strategy:
matrix:
os:
- ubuntu-22.04
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14-dev"
runs-on: ${{ matrix.os }}
env:
DRIVER: "container"
steps:
- name: Checkout source
uses: actions/checkout@v4

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

- name: Install minikube
run: |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube version
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install ./kubectl /usr/local/bin/
kubectl version --client --output=yaml
- name: Install tools
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: Start test cluster
run: make cluster
working-directory: test

- name: Run tests
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

drenv-macos:
name: drenv
strategy:
matrix:
os:
# arm64, 3 cpus (M1), 7 GiB RAM, no nested virtalization.
- macos-14
python-version:
- "3.13"
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 Homebrew packages
run: brew install kubectl

- 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.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14-dev"
include:
# arm64, 3 cpus (M1), 7 GiB RAM, no nested virtalization.
- os: macos-14
python-version: "3.13"
runs-on: ${{ matrix.os }}
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: ramenctl

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

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

0 comments on commit 8c333b2

Please sign in to comment.