Skip to content

Commit

Permalink
ci: adding ci to test latest changes
Browse files Browse the repository at this point in the history
This commits add changes to test the latest changes
which not yet release in rook-ceph krew plugin.

Signed-off-by: subhamkrai <srai@redhat.com>
  • Loading branch information
subhamkrai committed Jan 6, 2022
1 parent 301e155 commit d077fc1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 23 deletions.
54 changes: 31 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,18 @@ defaults:
shell: bash --noprofile --norc -eo pipefail -x {0}

jobs:
Plugin-test:
test-with-plugin:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup minikube
uses: manusa/actions-setup-minikube@v2.4.2
- name: setup cluster
uses: ./.github/workflows/cluster-setup
with:
minikube version: 'v1.23.2'
kubernetes version: 'v1.22.2'
start args: --memory 6g --cpus=2
github token: ${{ secrets.GITHUB_TOKEN }}

- name: print k8s cluster status
run: |
minikube status
kubectl get nodes
- name: use local disk
run: tests/github-action-helper.sh use_local_disk

- name: deploy rook cluster
run: tests/github-action-helper.sh deploy_rook

- name: wait for operator pod to be ready
run: tests/github-action-helper.sh wait_for_pod_to_be_ready_state
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: install krew
run: tests/github-action-helper.sh install_krew
Expand All @@ -48,11 +31,36 @@ jobs:
kubectl rook-ceph ceph status
kubectl rook-ceph ceph status -f json
kubectl rook-ceph ceph status --format json-pretty
kubectl rook-ceph ceph mon dump
kubectl rook-ceph ceph mon stat
kubectl rook-ceph ceph osd tree
- name: setup tmate session
if: failure()
uses: mxschmitt/action-tmate@v3
timeout-minutes: 180

# This test is required to test latest changes or the changes that not present
# with current version of rook-ceph krew plugin
test-with-pr-changes:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup cluster
uses: ./.github/workflows/cluster-setup
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: install script
run: sudo install kubectl-rook-ceph.sh /usr/local/bin/kubectl-rook_ceph

- name: Test Plugin
run: |
# run ceph commands with the plugin
kubectl rook_ceph ceph status
kubectl rook_ceph ceph status -f json
kubectl rook_ceph ceph status --format json-pretty
# run command operator restart
kubectl rook_ceph operator restart
35 changes: 35 additions & 0 deletions .github/workflows/cluster-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Cluster Setup
description: Cluster setup for plugin test
inputs:
github-token:
description: GITHUB_TOKEN from the calling workflow
required: true

runs:
using: "composite"
steps:
- name: setup minikube
uses: manusa/actions-setup-minikube@v2.4.2
with:
minikube version: 'v1.23.2'
kubernetes version: 'v1.22.2'
start args: --memory 6g --cpus=2
github token: ${{ inputs.github-token }}

- name: print k8s cluster status
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
minikube status
kubectl get nodes
- name: use local disk
shell: bash --noprofile --norc -eo pipefail -x {0}
run: tests/github-action-helper.sh use_local_disk

- name: deploy rook cluster
shell: bash --noprofile --norc -eo pipefail -x {0}
run: tests/github-action-helper.sh deploy_rook

- name: wait for operator pod to be ready
shell: bash --noprofile --norc -eo pipefail -x {0}
run: tests/github-action-helper.sh wait_for_pod_to_be_ready_state

0 comments on commit d077fc1

Please sign in to comment.