From 8fb9a16f81ef5e88b493c9e0e9bacc75206ac50e Mon Sep 17 00:00:00 2001 From: Andrei Pavlov Date: Fri, 21 Jun 2024 12:11:26 +0700 Subject: [PATCH 1/2] Add go mod tidy to test target Signed-off-by: Andrei Pavlov --- .github/workflows/test.yml | 2 -- Makefile | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49b98ec98..fdfad2145 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,8 +38,6 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - name: Check go mod - run: go mod tidy && git diff --exit-code - name: Lint uses: golangci/golangci-lint-action@v6 with: diff --git a/Makefile b/Makefile index 9a40297a3..b764e5b88 100644 --- a/Makefile +++ b/Makefile @@ -73,8 +73,12 @@ fmt: ## Run go fmt against code. vet: ## Run go vet against code. go vet ./... +.PHONY: tidy +tidy: + go mod tidy + .PHONY: test -test: generate-all fmt vet envtest external-crd ## Run tests. +test: generate-all fmt vet envtest external-crd tidy ## Run tests. KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out # Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors. From bbb7536ae45c6fc4294cb5736b2f7ac0fb63eb81 Mon Sep 17 00:00:00 2001 From: Andrei Pavlov Date: Fri, 21 Jun 2024 12:12:34 +0700 Subject: [PATCH 2/2] Update go version to 1.22 in gh workflows Signed-off-by: Andrei Pavlov --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fdfad2145..457bfeb14 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ on: - '**.md' env: - GO_VERSION: '1.21' + GO_VERSION: '1.22' jobs: build: