From 95167fdba1fd8ba16402473b05cc7edc16d8d4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 17 May 2023 19:42:44 +0200 Subject: [PATCH] [chore] Run generate before lint (#3819) * Run generate before lint * Fix step name * Update Makefile * Update Makefile * only go generate --------- Co-authored-by: Tyler Yahn --- .github/workflows/ci.yml | 2 ++ Makefile | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a04ed47e67b..5364c9e3284 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,8 @@ jobs: with: path: ~/.tools key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} + - name: Run go generate + run: make generate - name: Run linters run: make dependabot-check license-check lint vanity-import-check - name: Build diff --git a/Makefile b/Makefile index 599af64cd0e..6ff3ce9f788 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,8 @@ TIMEOUT = 60 .DEFAULT_GOAL := precommit .PHONY: precommit ci -precommit: dependabot-generate license-check misspell go-mod-tidy vanity-import-fix golangci-lint-fix test-default -ci: dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage +precommit: generate dependabot-generate license-check misspell go-mod-tidy vanity-import-fix golangci-lint-fix test-default +ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage # Tools @@ -70,9 +70,9 @@ $(CROSSLINK): PACKAGE=go.opentelemetry.io/build-tools/crosslink tools: $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(MULTIMOD) $(DBOTCONF) $(CROSSLINK) -# Build +# Generate -.PHONY: generate build +.PHONY: generate generate: $(OTEL_GO_MOD_DIRS:%=generate/%) generate/%: DIR=$* @@ -81,7 +81,11 @@ generate/%: | $(STRINGER) && cd $(DIR) \ && PATH="$(TOOLS):$${PATH}" $(GO) generate ./... -build: generate $(OTEL_GO_MOD_DIRS:%=build/%) $(OTEL_GO_MOD_DIRS:%=build-tests/%) +# Build + +.PHONY: build + +build: $(OTEL_GO_MOD_DIRS:%=build/%) $(OTEL_GO_MOD_DIRS:%=build-tests/%) build/%: DIR=$* build/%: @echo "$(GO) build $(DIR)/..." \