From f9334c077705ce32f4391e881600d7cb46a1126d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kmie=C4=87?= Date: Tue, 18 Mar 2025 11:23:25 +0000 Subject: [PATCH 1/4] Using gcr in ci --- .circleci/config.yml | 4 ++-- Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 72fd87e5..38f14b2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,13 +19,13 @@ aliases: parameters: goImage: type: string - default: "gcr.io/gcr-for-testing/golang:1.22.6" + default: "gcr.io/gcr-for-testing/golang:1.22.12" arangodbImage: type: string default: "gcr.io/gcr-for-testing/arangodb/enterprise-preview:devel-nightly" alpineImage: type: string - default: "gcr.io/gcr-for-testing/alpine:3.17" + default: "gcr.io/gcr-for-testing/alpine:3.21" starterImage: type: string default: "arangodb/arangodb-starter:latest" diff --git a/Makefile b/Makefile index d3a09f9e..3daa764e 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ROOTDIR:=$(CURR) GOVERSION ?= 1.22.12 GOIMAGE ?= golang:$(GOVERSION) GOV2IMAGE ?= $(GOIMAGE) -ALPINE_IMAGE ?= alpine:3.17 +ALPINE_IMAGE ?= alpine:3.21 TMPDIR := ${SCRIPTDIR}/.tmp DOCKER_CMD:=docker run From b3d35c99fce6ac42fb47e6c8f9d557037d4cd57b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kmie=C4=87?= Date: Tue, 18 Mar 2025 12:57:53 +0000 Subject: [PATCH 2/4] use docker golang --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 38f14b2d..f76a24b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ orbs: executors: golang-executor: docker: - - image: gcr.io/gcr-for-testing/golang:1.22.12 + - image: golang:1.22.12 machine-executor: machine: image: ubuntu-2204:current @@ -19,7 +19,7 @@ aliases: parameters: goImage: type: string - default: "gcr.io/gcr-for-testing/golang:1.22.12" + default: "golang:1.22.12" arangodbImage: type: string default: "gcr.io/gcr-for-testing/arangodb/enterprise-preview:devel-nightly" From ba5f3d91e42b1624822d2805cf0fd1ff3c733600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kmie=C4=87?= Date: Wed, 19 Mar 2025 09:11:49 +0000 Subject: [PATCH 3/4] Updated Go Version in CI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f76a24b0..91335f3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ aliases: parameters: goImage: type: string - default: "golang:1.22.12" + default: "gcr.io/gcr-for-testing/golang:1.22.12" arangodbImage: type: string default: "gcr.io/gcr-for-testing/arangodb/enterprise-preview:devel-nightly" From 002221e6bf04e3e66a77b87b4ed62c798b96f4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kmie=C4=87?= Date: Mon, 24 Mar 2025 08:49:29 +0000 Subject: [PATCH 4/4] Using goimage from GCR --- Makefile | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3daa764e..59428980 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ GOBUILDTAGSOPT=-tags "$(GOBUILDTAGS)" ARANGODB ?= arangodb/arangodb:latest STARTER ?= arangodb/arangodb-starter:latest +BASH_NOP = /bin/true +BUILD_GO_BINARY_DEPENDENCIES := $(BASH_NOP) + ifndef TESTOPTIONS TESTOPTIONS := endif @@ -149,13 +152,33 @@ else endif ifeq ("$(ADD_TIMESTAMP)", "true") - ADD_TIMESTAMP :=| go run ./test/timestamp_output/timestamp_output.go + ADD_TIMESTAMP_CMD :=| bash ./test/timestamp_output/timestamp_output_binary + BUILD_GO_BINARY_DEPENDENCIES := $(BUILD_GO_BINARY_DEPENDENCIES) && go build -o ./test/timestamp_output/timestamp_output_binary ./test/timestamp_output/timestamp_output.go +endif + +ifdef $(DUMP_AGENCY_ON_FAILURE) + BUILD_GO_BINARY_DEPENDENCIES := $(BUILD_GO_BINARY_DEPENDENCIES) && go build -o ./test/json_agency_config_parse_leader_id/json_agency_config_parse_leader_id_binary ./test/json_agency_config_parse_leader_id/json_agency_config_parse_leader_id.go endif .PHONY: all build clean linter run-tests vulncheck all: build +build_go_binary_dependencies: + if [ "$(BUILD_GO_BINARY_DEPENDENCIES)" != "$(BASH_NOP)" ]; then\ + echo "Building Go Dependencies Binaries";\ + echo "$(BUILD_GO_BINARY_DEPENDENCIES)";\ + echo "$(ADD_TIMESTAMP_CMD)";\ + $(DOCKER_CMD) --rm \ + -v "${ROOTDIR}":/usr/code \ + -e CGO_ENABLED=$(CGO_ENABLED) \ + -w /usr/code/ \ + $(GOIMAGE) \ + $(BUILD_GO_BINARY_DEPENDENCIES) && ls -al ./test/timestamp_output; \ + fi \ + + + build: __dir_setup $(SOURCES) go build -v $(REPOPATH) $(REPOPATH)/http $(REPOPATH)/vst $(REPOPATH)/agency $(REPOPATH)/jwt @@ -438,8 +461,8 @@ DOCKER_V1_CMD_PARAMS=\ -v "${ROOTDIR}":/usr/code ${TEST_RESOURCES_VOLUME} \ -w /usr/code/ -__test_go_test: - ($(DOCKER_CMD) $(DOCKER_V1_CMD_PARAMS) $(DOCKER_RUN_CMD) $(ADD_TIMESTAMP)) && echo "success!" \ +__test_go_test: build_go_binary_dependencies + ($(DOCKER_CMD) $(DOCKER_V1_CMD_PARAMS) $(DOCKER_RUN_CMD) $(ADD_TIMESTAMP_CMD)) && echo "success!" \ || ( $(ON_FAILURE_PARAMS) MAJOR_VERSION=1 . ./test/on_failure.sh) @@ -451,8 +474,8 @@ DOCKER_CMD_V2_PARAMS=\ -v "${ROOTDIR}":/usr/code:ro ${TEST_RESOURCES_VOLUME} \ -w /usr/code/v2/ -__test_v2_go_test: - ($(DOCKER_CMD) $(DOCKER_CMD_V2_PARAMS) $(DOCKER_V2_RUN_CMD) $(ADD_TIMESTAMP)) && echo "success!" \ +__test_v2_go_test: build_go_binary_dependencies + ($(DOCKER_CMD) $(DOCKER_CMD_V2_PARAMS) $(DOCKER_V2_RUN_CMD) $(ADD_TIMESTAMP_CMD)) && echo "success!" \ || ($(ON_FAILURE_PARAMS) MAJOR_VERSION=2 . ./test/on_failure.sh) __test_debug__: