From 2a3f2d7a424ee76e812b14f97e03a28b36a71cb5 Mon Sep 17 00:00:00 2001 From: Luca Burgazzoli Date: Mon, 2 Sep 2024 15:46:04 +0200 Subject: [PATCH] chore(ci): cleanup github actions (#218) * chore(ci): cleanup github actions Signed-off-by: Luca Burgazzoli * chore(ci): use make target to setup kind Signed-off-by: Luca Burgazzoli --------- Signed-off-by: Luca Burgazzoli --- .github/workflows/build.yml | 2 -- .github/workflows/e2e-olm.yml | 23 ++++++++++++----------- .github/workflows/e2e-operator.yml | 23 ++++++++++++----------- .github/workflows/publish.yml | 10 ---------- Makefile | 15 ++++++++++++--- 5 files changed, 36 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f710d1d..d10c212 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,6 @@ jobs: steps: - name: "Checkout" uses: actions/checkout@v4 - with: - ref: ${{ inputs.tag }} - name: "Set up Go" uses: actions/setup-go@v5 with: diff --git a/.github/workflows/e2e-olm.yml b/.github/workflows/e2e-olm.yml index 69cc848..550cdbd 100644 --- a/.github/workflows/e2e-olm.yml +++ b/.github/workflows/e2e-olm.yml @@ -55,10 +55,10 @@ jobs: strategy: matrix: kubernetes-version: - - "1.27.13" - - "1.28.9" - - "1.29.4" - - "1.30.2" + - "1.27.16" + - "1.28.13" + - "1.29.8" + - "1.30.4" steps: - name: "Checkout" uses: actions/checkout@v4 @@ -67,14 +67,15 @@ jobs: with: go-version-file: 'go.mod' check-latest: true - - name: 'SetUp KinD' - uses: container-tools/kind-action@v2.0.4 + - name: 'SetUp Kubectl' + uses: azure/setup-kubectl@v4 with: - version: "v0.23.0" - kubectl_version: v${{ matrix.kubernetes-version }} - registry: false - node_image: kindest/node:v${{ matrix.kubernetes-version }} - config: test/e2e/kind.yaml + version: v${{ matrix.kubernetes-version }} + - name: 'SetUp KinD' + env: + KIND_IMAGE_VERSION: v${{ matrix.kubernetes-version }} + run: | + make test/e2e/kind - name: 'SetUp Kind Ingress' run: | make deploy/e2e/ingress diff --git a/.github/workflows/e2e-operator.yml b/.github/workflows/e2e-operator.yml index 269d391..828fd7b 100644 --- a/.github/workflows/e2e-operator.yml +++ b/.github/workflows/e2e-operator.yml @@ -35,10 +35,10 @@ jobs: strategy: matrix: kubernetes-version: - - "1.27.13" - - "1.28.9" - - "1.29.4" - - "1.30.2" + - "1.27.16" + - "1.28.13" + - "1.29.8" + - "1.30.4" steps: - name: "Checkout" uses: actions/checkout@v4 @@ -47,14 +47,15 @@ jobs: with: go-version-file: 'go.mod' check-latest: true - - name: 'SetUp KinD' - uses: container-tools/kind-action@v2.0.4 + - name: 'SetUp Kubectl' + uses: azure/setup-kubectl@v4 with: - version: "v0.23.0" - kubectl_version: v${{ matrix.kubernetes-version }} - registry: false - node_image: kindest/node:v${{ matrix.kubernetes-version }} - config: test/e2e/kind.yaml + version: v${{ matrix.kubernetes-version }} + - name: 'SetUp KinD' + env: + KIND_IMAGE_VERSION: v${{ matrix.kubernetes-version }} + run: | + make test/e2e/kind - name: 'SetUp Kind Ingress' run: | make deploy/e2e/ingress diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6ad72be..0818f25 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -42,16 +42,6 @@ jobs: echo "CONTAINER_IMAGE_VERSION=${C_VERSION}" >> $GITHUB_ENV echo "BUNDLE_VERSION=${C_VERSION}" >> $GITHUB_ENV echo "CATALOG_VERSION=latest" >> $GITHUB_ENV - - - name: 'Dump debug info' - run: | - make docker/image/name 2>&1 > /tmp/docker-image-name.txt - - name: 'Upload debug info' - uses: actions/upload-artifact@v4 - with: - name: ocker-image-name.txt - path: /tmp/docker-image-name.txt - - name: "Build Dapr Kubernetes Operator Container image" run: | make docker/build diff --git a/Makefile b/Makefile index 3f9b657..495ddc6 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ CODEGEN_VERSION ?= v0.30.3 KUSTOMIZE_VERSION ?= v5.4.2 CONTROLLER_TOOLS_VERSION ?= v0.16.0 KIND_VERSION ?= v0.23.0 +KIND_IMAGE_VERSION ?= v1.30.4 LINTER_VERSION ?= v1.60.2 OPERATOR_SDK_VERSION ?= v1.36.1 OPM_VERSION ?= v1.45.0 @@ -139,6 +140,14 @@ test/e2e/olm: ## Run e2e catalog tests. test/e2e/app: ko ## Deploy test app. KO_DOCKER_REPO=kind.local $(LOCALBIN)/ko build -B ./test/e2e/support/dapr-test-app + +.PHONY: test/e2e/kind +test/e2e/kind: kind ## Deploy test app. + $(LOCALBIN)/kind create cluster \ + --image=kindest/node:$(KIND_IMAGE_VERSION) \ + --config=$(PROJECT_PATH)/test/e2e/kind.yaml \ + --wait=60s + ##@ Build .PHONY: build @@ -203,8 +212,8 @@ docker/push: ## Push docker image with the manager. $(CONTAINER_TOOL) push $(CONTAINER_IMAGE) .PHONY: docker/push/kind -docker/push/kind: docker/build ## Load docker image in kind. - kind load docker-image $(CONTAINER_IMAGE) +docker/push/kind: kind docker/build ## Load docker image in kind. + $(LOCALBIN)/kind load docker-image $(CONTAINER_IMAGE) .PHONY: docker/image/name docker/image/name: @@ -232,7 +241,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi .PHONY: deploy/kind deploy/kind: manifests kustomize kind ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image controller=$(CONTAINER_IMAGE) - kind load docker-image $(CONTAINER_IMAGE) + $(LOCALBIN)/ load docker-image $(CONTAINER_IMAGE) $(KUSTOMIZE) build config/deploy/standalone | kubectl apply -f - .PHONY: deploy/e2e/controller