diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c7162286..12b2dd11 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,12 +27,7 @@ jobs: contents: read packages: write steps: - # - name: Login to GHCR - # uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.repository_owner }} - # password: ${{ secrets.GITHUB_TOKEN }}` + - name: Set up Go 1.21 uses: actions/setup-go@v2 with: @@ -46,12 +41,23 @@ jobs: uses: actions/checkout@v2 - name: get go version run: go version - - name: install utilites - run: | - sudo apt-get update - sudo apt-get install -y build-essential conntrack - - name: make all (crds, manifests, checks, binary, images) - run: make all + - name: Gofmt and License checks + run: make check + - name: unit tests + run: make test + + # - name: Login to GHCR + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }}` + # - name: install utilites + # run: | + # sudo apt-get update + # sudo apt-get install -y build-essential conntrack + # - name: make all (crds, manifests, checks, binary, images) + # run: make all # - name: install kubectl # uses: azure/setup-kubectl@v3 # with: @@ -74,10 +80,10 @@ jobs: # run: | # kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default # kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username="testanisha" --docker-password="123456789" --docker-email=testimage456@gmail.com - # - uses: docker/setup-buildx-action@v3 # - name: Codecov # uses: codecov/codecov-action@v1.0.12 + - name: Set env run: | echo "KUBERNETES_VERSION=v1.23.1" >> $GITHUB_ENV @@ -88,6 +94,8 @@ jobs: run: | curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ curl -Lo minikube https://storage.googleapis.com/minikube/releases/$MINIKUBE_VERSION/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ + sudo mount --make-rshared / + sudo apt-get install -y conntrack CHANGE_MINIKUBE_NONE_USER=true export KUBERNETES_CONFIG_FILE=$HOME/.kube/config export KUBERNETES_CONFIG_FILE=$HOME/.kube/config;export CHANGE_MINIKUBE_NONE_USER=true;sudo minikube start --vm-driver=none --bootstrapper=kubeadm --kubernetes-version=$KUBERNETES_VERSION @@ -103,7 +111,7 @@ jobs: sudo kubectl -n kube-system get pod -o wide sudo kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username="testanisha" --docker-password="123456789" --docker-email=testimage456@gmail.com - name: E2E - run: make test-e2e + run: sudo make test-e2e publish: name: Publish docker image runs-on: diff --git a/Makefile b/Makefile index df7d8b16..ba8a55c9 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ crds: ## Generate CRDs deploy: manifests kustomize cd config/manager && $(KUSTOMIZE) edit set image pravega/zookeeper-operator=$(TEST_IMAGE) $(KUSTOMIZE) build config/default | kubectl apply -f - - kubectl wait --for condition=ESTABLISHED crd/zookeeperclusters.zookeeper.pravega.io --timeout=5m + #kubectl wait --for condition=ESTABLISHED crd/zookeeperclusters.zookeeper.pravega.io --timeout=5m # Deploy controller in the configured Kubernetes cluster in ~/.kube/config @@ -96,7 +96,7 @@ controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessar $(CONTROLLER_GEN): $(LOCALBIN) test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) -all: crds generate check build +all: generate check build generate: $(CONTROLLER_GEN) object paths="./..."