Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Tao Li <[email protected]>
  • Loading branch information
litaocdl committed Nov 14, 2024
1 parent 749158a commit d891570
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
outputs:
pg4k-pgd-changed: ${{ steps.filter.outputs.pg4k-pgd-changed }}
ep4k-changed: ${{ steps.filter.outputs.ep4k-changed }}
ep4k-lts-changed: ${{ steps.filter.outputs.ep4k-lts-changed }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -26,6 +27,8 @@ jobs:
- 'charts/edb-postgres-distributed-for-kubernetes/**'
ep4k-changed:
- 'charts/edb-postgres-for-kubernetes/**'
ep4k-lts-changed:
- 'charts/edb-postgres-distributed-for-kubernetes/charts/edb-postgres-for-kubernetes-lts/**'
deploy-ep4k:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -61,6 +64,40 @@ jobs:
PHASE="Cluster in healthy state"
kubectl wait --timeout=5m --for=jsonpath='{.status.phase}'="$PHASE" clusters/cluster-example
deploy-ep4k-lts:
runs-on: ubuntu-22.04
needs:
- change-triage
if: needs.change-triage.outputs.ep4k-lts-changed == 'true'
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3

- name: Create kind cluster
uses: helm/[email protected]

- name: Deploy using helm chart
run: |
helm upgrade --install edb-pg4k-lts --namespace postgresql-operator-system \
--create-namespace charts/edb-postgres-distributed-for-kubernetes/charts/edb-postgres-for-kubernetes-lts --wait
- name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Deploy a cluster
run: |
kubectl apply -f hack/samples/ep4k-cluster.yaml
PHASE="Cluster in healthy state"
kubectl wait --timeout=5m --for=jsonpath='{.status.phase}'="$PHASE" clusters/cluster-example
deploy-pg4k-pgd:
runs-on: ubuntu-22.04
needs:
Expand Down Expand Up @@ -141,3 +178,42 @@ jobs:
kubectl create ns test-ignore
kubectl -n test-ignore apply -f hack/samples/ep4k-cluster.yaml
kubectl -n test-ignore get pods 2>&1 >/dev/null | grep 'No resources found'
deploy-ep4k-lts-single-namespace:
runs-on: ubuntu-22.04
needs:
- change-triage
if: needs.change-triage.outputs.ep4k-lts-changed == 'true'
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3

- name: Create kind cluster
uses: helm/[email protected]

- name: Deploy in single-namespace mode using helm chart
run: |
helm upgrade --install edb-pg4k-lts --namespace single-install \
--set config.clusterWide=false \
--create-namespace charts/edb-postgres-distributed-for-kubernetes/charts/edb-postgres-for-kubernetes-lts --wait
- name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Deploy a cluster in the watched namespace
run: |
kubectl -n single-install apply -f hack/samples/ep4k-cluster.yaml
PHASE="Cluster in healthy state"
kubectl -n single-install wait --timeout=5m --for=jsonpath='{.status.phase}'="$PHASE" clusters/cluster-example
- name: Ignore deploying a cluster in another namespace
run: |
kubectl create ns test-ignore
kubectl -n test-ignore apply -f hack/samples/ep4k-cluster.yaml
kubectl -n test-ignore get pods 2>&1 >/dev/null | grep 'No resources found'

0 comments on commit d891570

Please sign in to comment.