File tree 3 files changed +66
-2
lines changed
3 files changed +66
-2
lines changed Original file line number Diff line number Diff line change
1
+ version : 2.1
2
+
3
+ orbs :
4
+ codecov : codecov/codecov@1
5
+
6
+ jobs :
7
+ build-and-test :
8
+ parameters :
9
+ go-version :
10
+ type : string
11
+ docker :
12
+ - image : cimg/go:<< parameters.go-version >>
13
+ steps :
14
+ - checkout
15
+ - run : make lint
16
+ - run : CGO_ENABLED=1 go test -coverprofile=coverage.txt -v ./...
17
+ - codecov/upload :
18
+ file : ./coverage.txt
19
+ - run : make build package
20
+
21
+ workflows :
22
+ version : 2
23
+ build-and-test :
24
+ jobs :
25
+ - build-and-test :
26
+ matrix :
27
+ parameters :
28
+ go-version : ["1.15"] # we should add tip here too
Original file line number Diff line number Diff line change
1
+ run :
2
+ deadline : 5m
3
+
4
+ linters :
5
+ disable-all : true
6
+ enable :
7
+ - dupl
8
+ - goconst
9
+ # - gocyclo response wrapper for server handler is too complex
10
+ - gofmt
11
+ - golint
12
+ - govet
13
+ - ineffassign
14
+ # - interfacer
15
+ - lll
16
+ - misspell
17
+ - nakedret
18
+ - structcheck
19
+ - unparam
20
+ - varcheck
21
+
22
+ linters-settings :
23
+ dupl :
24
+ threshold : 400
25
+ lll :
26
+ line-length : 170
27
+ gocyclo :
28
+ min-complexity : 15
29
+ golint :
30
+ min-confidence : 0.85
Original file line number Diff line number Diff line change 1
- BIN_NAME =xfiles
2
-
3
1
VERSION ?= dev
4
2
GIT_HASH ?=$(shell git rev-parse HEAD)
5
3
IMAGE_NAME := "hypertrace/collector"
6
4
5
+ .PHONY : build
7
6
build :
8
7
go build -ldflags " -w -X main.GitHash=${GIT_HASH} -X main.Version=${VERSION} " ./cmd/collector
9
8
9
+ .PHONY : run
10
10
run :
11
11
go run cmd/collector/main.go --config ./config.yml
12
12
13
+ .PHONY : package
13
14
package :
14
15
docker build --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=$(GIT_COMMIT ) -t $(IMAGE_NAME ) :${VERSION} -t $(IMAGE_NAME ) :latest .
16
+
17
+ .PHONY : lint
18
+ lint :
19
+ @echo " Running linters..."
20
+ @golangci-lint run ./... && echo " Done."
You can’t perform that action at this time.
0 commit comments