Skip to content

Update tests.yaml

Update tests.yaml #7

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Kind Cluster
uses: helm/kind-action@v1
with:
cluster_name: test-cluster
- name: Build the Weaviate Operator image
run: make docker-build
- name: Push operator image to Kind cluster
run: |
# Get VERSION from the Makefile
VERSION=$(sed -n 's/^VERSION ?= //p' Makefile)
# Get IMAGE_TAG_BASE from the Makefile
IMAGE_TAG_BASE=$(sed -n 's/^IMAGE_TAG_BASE ?= //p' Makefile)
# Name of the kind cluster (modify as needed)
KIND_CLUSTER_NAME=test-cluster
# Construct the full image tag
FULL_IMAGE_TAG="${IMAGE_TAG_BASE}:${VERSION}"
# Load the docker image into the kind cluster
echo "Loading image ${FULL_IMAGE_TAG} into kind cluster ${KIND_CLUSTER_NAME}..."
kind load docker-image "$FULL_IMAGE_TAG" --name "$KIND_CLUSTER_NAME"
- name: Install Weaviate Operator
run: make deploy
- name: Wait for weaviate-operator-controller-manager to be ready
run: |
kubectl wait --for=condition=available deployment/weaviate-operator-controller-manager -n weaviate-operator-system --timeout=300s
if [ $? -ne 0 ]; then
kubectl logs deployment/weaviate-operator-controller-manager -n weaviate-operator-system
fi
- name: Create Weaviate namespace
run: kubectl create namespace weaviate
- name: Install CR
run: kubectl apply -f config/samples/apps_v1alpha1_weaviatecluster.yaml -n weaviate
- name: Wait for WeaviateCluster to be Initialized
run:
kubectl wait weaviatecluster/weaviatecluster-sample -n weaviate --for condition=Initialized --timeout=300s;
- name: Wait for Pods to be Ready
run: |
kubectl wait sts/weaviate -n weaviate --for jsonpath='{.status.readyReplicas}'=3 --timeout=300s
if [ $? -ne 0 ]; then
kubectl logs -l app=weaviate -n weaviate --all-containers=true --prefix
fi