You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2020/07/08 14:24:29 UTC

[skywalking-cli] 01/01: chore: move tools setup into Makefile to easy the setup work locally

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch chore/packr2
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 38f1bdf476025653bbf17dd956551cbebffef4a2
Author: kezhenxu94 <ke...@163.com>
AuthorDate: Wed Jul 8 22:24:04 2020 +0800

    chore: move tools setup into Makefile to easy the setup work locally
---
 .github/workflows/go.yml |  6 ------
 Makefile                 | 20 ++++++++++++--------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index d343adf..936d076 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -35,12 +35,6 @@ jobs:
           go-version: 1.13
         id: go
 
-      - name: Set up Packr
-        run: go get -u github.com/gobuffalo/packr/v2/...
-
-      - name: Set up GQLGen
-        run: go get -u github.com/99designs/gqlgen
-
       - name: Check out code into the Go module directory
         uses: actions/checkout@v2
 
diff --git a/Makefile b/Makefile
index f932f3a..7c7a964 100644
--- a/Makefile
+++ b/Makefile
@@ -44,10 +44,16 @@ SHELL = /bin/bash
 
 all: clean license deps codegen lint test build
 
-deps:
+tools:
+	$(GO_PACKR) -v || go get -u github.com/gobuffalo/packr/v2/...
+	$(GO_LINT) version || curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin v1.21.0
+	$(GO_LICENSER) -version || GO111MODULE=off $(GO_GET) -u github.com/elastic/go-licenser
+	$(GQL_GEN) version || go get -u github.com/99designs/gqlgen
+
+deps: tools
 	$(GO_GET) -v -t -d ./...
 
-codegen: clean
+codegen: clean tools
 	echo 'scalar Long' > query-protocol/schema.graphqls
 	$(GQL_GEN) generate
 	-rm -rf generated.go
@@ -59,8 +65,7 @@ $(PLATFORMS):
 	GOOS=$(os) GOARCH=$(ARCH) $(GO_BUILD) $(GO_BUILD_FLAGS) -ldflags "$(GO_BUILD_LDFLAGS)" -o $(OUT_DIR)/$(BINARY)-$(VERSION)-$(os)-$(ARCH) cmd/main.go
 
 .PHONY: lint
-lint: codegen
-	$(GO_LINT) version || curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin v1.21.0
+lint: codegen tools
 	$(GO_LINT) run -v ./...
 
 .PHONE: test
@@ -71,15 +76,14 @@ test: clean codegen lint
 build: deps windows linux darwin
 
 .PHONY: license
-license: clean
-	$(GO_LICENSER) -version || GO111MODULE=off $(GO_GET) -u github.com/elastic/go-licenser
+license: clean tools
 	$(GO_LICENSER) -d -licensor='Apache Software Foundation (ASF)' .
 
 .PHONY: verify
 verify: clean lint test license
 
 .PHONY: fix
-fix:
+fix: tools
 	$(GO_LINT) run -v --fix ./...
 	$(GO_LICENSER) -licensor='Apache Software Foundation (ASF)' .
 
@@ -88,7 +92,7 @@ coverage: test
 	bash <(curl -s https://codecov.io/bash) -t a5af28a3-92a2-4b35-9a77-54ad99b1ae00
 
 .PHONY: clean
-clean:
+clean: tools
 	-rm -rf bin
 	-rm -rf coverage.txt
 	-rm -rf query-protocol/schema.graphqls