Skip to content

Commit

Permalink
chore(CI): update CI workflow and makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Feb 26, 2024
1 parent 359cdb1 commit 76cd1f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/addlicense.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: addlicense-check
run: |
go install github.com/google/addlicense@latest
find . -type f -name "*.go" -not -path "./distribution/*" | xargs addlicense -check
find . -type f -name "*.go" -not -path "./distribution/*" -not -path "**/generated/*" | xargs addlicense -check
8 changes: 4 additions & 4 deletions make/dashboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ GOFILES ?= $(shell git ls-files '*.go')
GOTEST_PACKAGES = $(shell go list ./... | grep -v -f tests/excludes.txt)
UNFMT_FILES ?= $(shell gofmt -l -s $(filter-out , $(GOFILES)))

.PHONY: doc
doc: dep-install ## Generate swagger docs
swag init -g cmd/dashboard/main.go -o internal/dashboard/swagger
.PHONY: dashboard-doc
dashboard-doc: dep-install ## Generate swagger docs
swag init -g cmd/dashboard/main.go -o internal/dashboard/generated/swagger

.PHONY: build-dashboard
build-dashboard: ## Build oceanbase-dashboard
$(GOBUILD) -o bin/oceanbase-dashboard ./cmd/dashboard/main.go

.PHONY: gen-bindata
gen-bindata: ## Generate bindata
go-bindata -o internal/bindata/bindata.go -pkg bindata internal/assets/...
go-bindata -o internal/dashboard/generated/bindata/bindata.go -pkg bindata internal/assets/...

.PHONY: clean
clean: ## Clean build
Expand Down
9 changes: 9 additions & 0 deletions make/development.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ $(GOLANGCI_LINT):
lint: $(GOLANGCI_LINT) ## Run linting.
$(GOLANGCI_LINT) run -v --timeout=10m --max-same-issues=1000

.PHONY: ADD_LICENSE_CHECKER
ADD_LICENSE_CHECKER ?= $(LOCALBIN)/addlicense
$(ADD_LICENSE_CHECKER):
GOBIN=$(LOCALBIN) go install github.com/google/addlicense@latest

.PHONY: license-check
license-check: $(ADD_LICENSE_CHECKER) ## Check whether all license headers are present.
find . -type f -name "*.go" -not -path "./distribution/*" -not -path "**/generated/*" | xargs addlicense -check

.PHONY: commit-hook
commit-hook: $(GOLANGCI_LINT) ## Install commit hook.
touch .git/hooks/pre-commit
Expand Down

0 comments on commit 76cd1f7

Please sign in to comment.