From 96790deb8eeabebb1a6e7d40b3c424e9b459eba3 Mon Sep 17 00:00:00 2001 From: Alexandr Demicev Date: Tue, 3 Dec 2024 16:21:34 +0100 Subject: [PATCH] Use docker build for e2e image Signed-off-by: Alexandr Demicev --- .github/workflows/run-e2e-suite.yaml | 11 ++--------- Makefile | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/run-e2e-suite.yaml b/.github/workflows/run-e2e-suite.yaml index ce25e603..a8497a5e 100644 --- a/.github/workflows/run-e2e-suite.yaml +++ b/.github/workflows/run-e2e-suite.yaml @@ -90,18 +90,11 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - name: Build and push e2e image if: ${{ inputs.MANAGEMENT_CLUSTER_ENVIRONMENT == 'eks' }} - run: CACHE_DIR=/tmp/.buildx-cache make e2e-image-push + run: make e2e-image-push - name: Run e2e tests - run: CACHE_DIR=/tmp/.buildx-cache make test-e2e + run: make test-e2e - name: Collect run artifacts if: always() uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index c570fdd7..01c9a179 100644 --- a/Makefile +++ b/Makefile @@ -592,16 +592,23 @@ test-e2e-push-image: $(GINKGO) $(HELM) $(CLUSTERCTL) kubectl e2e-image-push $(E2E_RUN_COMMAND) .PHONY: e2e-image -e2e-image: $(CACHE_DIR) ## Build the image for e2e tests - ADDITIONAL_COMMANDS=$(CACHE_COMMANDS) TAG=v0.0.1 CONTROLLER_IMAGE_NAME=turtles-e2e $(MAKE) docker-build +e2e-image: ## Build the image for e2e tests + CONTROLLER_IMG=$(REGISTRY)/$(ORG)/turtles-e2e $(MAKE) e2e-image-build RELEASE_TAG=v0.0.1 CONTROLLER_IMG=$(REGISTRY)/$(ORG)/turtles-e2e \ CONTROLLER_IMAGE_VERSION=v0.0.1 \ $(MAKE) build-chart +.PHONY: e2e-image-build +e2e-image-build: ## Build the image for e2e tests + docker build \ + --build-arg builder_image=$(GO_CONTAINER_IMAGE) \ + --build-arg goproxy=$(GOPROXY) \ + --build-arg package=. \ + --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG):v0.0.1 + .PHONY: e2e-image-push -e2e-image-push: $(CACHE_DIR) ## Push the image for e2e tests - TARGET_PLATFORMS=$(ARCH) TAG=v0.0.1 CONTROLLER_IMAGE_NAME=turtles-e2e \ - ADDITIONAL_COMMANDS=$(CACHE_COMMANDS) $(MAKE) docker-build-and-push +e2e-image-push: ## Push the image for e2e tests + docker push $(CONTROLLER_IMG):v0.0.1 .PHONY: compile-e2e e2e-compile: ## Test e2e compilation