From d0d3916115001a26fb960a0e0cb3e8d2fb74bf03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 17 May 2023 10:28:21 +0200 Subject: [PATCH 1/5] Run generate before lint --- .github/workflows/ci.yml | 4 +++- Makefile | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a04ed47e67b..c7b420a15b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,8 +43,10 @@ jobs: with: path: ~/.tools key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} + - name: Run go generate + run: make generate vanity-import-fix - name: Run linters - run: make dependabot-check license-check lint vanity-import-check + run: make dependabot-check license-check lint - name: Build run: make build - name: Check clean repository diff --git a/Makefile b/Makefile index 599af64cd0e..efbe1bd63dd 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: dependabot-generate generate vanity-import-fix license-check misspell go-mod-tidy golangci-lint-fix test-default +ci: generate vanity-import-fix dependabot-check license-check lint test-default build 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)/..." \ From 1945b0d4fa2157d6dbec9c2e9060894496c56dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 17 May 2023 10:29:32 +0200 Subject: [PATCH 2/5] Fix step name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7b420a15b5..1b7988efa52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: with: path: ~/.tools key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} - - name: Run go generate + - name: Run go generate and vanity-import-fix run: make generate vanity-import-fix - name: Run linters run: make dependabot-check license-check lint From 835354ecd7b52b4cec96128a4d87fbe5b9842065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 17 May 2023 10:31:44 +0200 Subject: [PATCH 3/5] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index efbe1bd63dd..385d31e5c59 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ TIMEOUT = 60 .PHONY: precommit ci precommit: dependabot-generate generate vanity-import-fix license-check misspell go-mod-tidy golangci-lint-fix test-default -ci: generate vanity-import-fix dependabot-check license-check lint test-default build check-clean-work-tree test-coverage +ci: generate vanity-import-fix dependabot-check license-check lint build test-default check-clean-work-tree test-coverage # Tools From e37088fb10243f374cb2ed1adfcdb0155fd8cb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 17 May 2023 10:32:32 +0200 Subject: [PATCH 4/5] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 385d31e5c59..73970a7fd3d 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ TIMEOUT = 60 .DEFAULT_GOAL := precommit .PHONY: precommit ci -precommit: dependabot-generate generate vanity-import-fix license-check misspell go-mod-tidy golangci-lint-fix test-default +precommit: generate vanity-import-fix dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default ci: generate vanity-import-fix dependabot-check license-check lint build test-default check-clean-work-tree test-coverage # Tools From 8cd504710d05f7e853d90ca7a6a8c2075fff0da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 17 May 2023 10:53:24 +0200 Subject: [PATCH 5/5] only go generate --- .github/workflows/ci.yml | 6 +++--- Makefile | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b7988efa52..5364c9e3284 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,10 +43,10 @@ jobs: with: path: ~/.tools key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} - - name: Run go generate and vanity-import-fix - run: make generate vanity-import-fix + - name: Run go generate + run: make generate - name: Run linters - run: make dependabot-check license-check lint + run: make dependabot-check license-check lint vanity-import-check - name: Build run: make build - name: Check clean repository diff --git a/Makefile b/Makefile index 73970a7fd3d..6ff3ce9f788 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,8 @@ TIMEOUT = 60 .DEFAULT_GOAL := precommit .PHONY: precommit ci -precommit: generate vanity-import-fix dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default -ci: generate vanity-import-fix dependabot-check license-check lint 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