You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
Add Circle ci (#41)
* fix compile errors. * fix lint errors. * add circle-ci job. * rename IDHigh to TraceIDHigh * rename the file. * add go get for goimports and golangci-lint * enable GO111MODULE and remove comments. * remove working dir and update cache name * Add TEST_RESULT env back. * run go mod tidy. * remove go mod download. * add test coverage. * fix TraceID. * fix circlefi config error. * remove install-tools. * remove ALL_TEST_SRC from Makefile.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
ALL_SRC := $(shell find . -name '*.go' -type f | sort)
|
||||
ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC))))
|
||||
|
||||
GOTEST=go test
|
||||
GOTEST_OPT?=-v -race -timeout 30s
|
||||
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
|
||||
|
||||
.DEFAULT_GOAL := precommit
|
||||
|
||||
.PHONY: precommit
|
||||
|
||||
TOOLS_DIR := ./.tools
|
||||
@@ -10,4 +19,26 @@ $(TOOLS_DIR)/goimports: go.mod go.sum tools.go
|
||||
|
||||
precommit: $(TOOLS_DIR)/goimports $(TOOLS_DIR)/golangci-lint
|
||||
$(TOOLS_DIR)/goimports -d -local github.com/open-telemetry/opentelemetry-go -w .
|
||||
$(TOOLS_DIR)/golangci-lint run
|
||||
$(TOOLS_DIR)/golangci-lint run # TODO: Fix this on windows.
|
||||
|
||||
.PHONY: test-with-coverage
|
||||
test-with-coverage:
|
||||
$(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS)
|
||||
go tool cover -html=coverage.txt -o coverage.html
|
||||
|
||||
.PHONY: circle-ci
|
||||
circle-ci: precommit test-with-coverage test-386
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
$(GOTEST) $(GOTEST_OPT) $(ALL_PKGS)
|
||||
|
||||
.PHONY: test-386
|
||||
test-386:
|
||||
GOARCH=386 $(GOTEST) -v -timeout 30s $(ALL_PKGS)
|
||||
|
||||
all-pkgs:
|
||||
@echo $(ALL_PKGS) | tr ' ' '\n' | sort
|
||||
|
||||
all-srcs:
|
||||
@echo $(ALL_SRC) | tr ' ' '\n' | sort
|
||||
|
||||
Reference in New Issue
Block a user