File tree Expand file tree Collapse file tree 4 files changed +143
-2
lines changed Expand file tree Collapse file tree 4 files changed +143
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - " **"
7
+ push :
8
+ branches :
9
+ - " **"
10
+
11
+ jobs :
12
+ lint :
13
+ name : Lint
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Set up Go
17
+ uses : actions/setup-go@v2
18
+ with :
19
+ go-version : 1.17
20
+
21
+ - name : Check out code
22
+ uses : actions/checkout@v2
23
+
24
+ - name : Lint
25
+ run : make lint
26
+
27
+ build :
28
+ name : Build
29
+ runs-on : ubuntu-latest
30
+ steps :
31
+ - name : Set up Go
32
+ uses : actions/setup-go@v2
33
+ with :
34
+ go-version : 1.17
35
+
36
+ - name : Check out code
37
+ uses : actions/checkout@v2
38
+
39
+ - name : Build
40
+ run : make build
41
+
42
+ - name : Bin
43
+ uses : actions/upload-artifact@v2
44
+ with :
45
+ name : binance-proxy
46
+ path : ./bin/binance-proxy
47
+
48
+ # ## Tests not yet integrated ...
49
+ # test:
50
+ # name: Test
51
+ # runs-on: ubuntu-latest
52
+ # steps:
53
+ # - name: Set up Go
54
+ # uses: actions/setup-go@v2
55
+ # with:
56
+ # go-version: 1.17
57
+
58
+ # - name: Check out code
59
+ # uses: actions/checkout@v2
60
+
61
+ # - name: Test
62
+ # run: make cover
63
+
64
+ # - name: Cover
65
+ # uses: actions/upload-artifact@v2
66
+ # with:
67
+ # name: cover
68
+ # path: ./cover.html
Original file line number Diff line number Diff line change 31
31
- name : Set up Go
32
32
uses : actions/setup-go@v2
33
33
with :
34
- go-version : 1.16
34
+ go-version : 1.17
35
35
36
36
- name : Run GoReleaser
37
37
uses : goreleaser/goreleaser-action@v2
Original file line number Diff line number Diff line change 10
10
11
11
# Output of the go coverage tool, specifically when used with LiteIDE
12
12
* .out
13
-
13
+ cover. *
14
14
# Dependency directories (remove the comment below to include it)
15
15
vendor /
16
16
dist /
17
+ bin /
17
18
18
19
# IDE's
19
20
/.idea /*
Original file line number Diff line number Diff line change
1
+ PROJECT := binance-proxy
2
+ VERSION := $(git describe --abbrev=0 --tags )
3
+ LD_FLAGS := -X main.version=$(VERSION ) -s -w
4
+ SOURCE_FILES ?= ./internal/... ./pkg/... ./cmd/...
5
+ UNAME := $(uname -s )
6
+
7
+ export CGO_ENABLED =0
8
+ export GO111MODULE =on
9
+
10
+ .PHONY : all
11
+ all : help
12
+
13
+ .PHONY : help
14
+ help : # ## Show targets documentation
15
+ ifeq ($(UNAME ) , Linux)
16
+ @grep -P '^[a-zA-Z_-]+:.*?# # .*$$' $(MAKEFILE_LIST) | sort | \
17
+ awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
18
+ else
19
+ @awk -F ':.*# ##' '$$0 ~ FS {printf "%15s%s\n", $$1 ":", $$2}' \
20
+ $(MAKEFILE_LIST) | grep -v '@awk' | sort
21
+ endif
22
+
23
+ .PHONY : clean
24
+ clean : # ## Clean build files
25
+ @rm -rf ./bin
26
+ @go clean
27
+
28
+ .PHONY : build
29
+ build : clean # ## Build binary
30
+ @go build -tags netgo -a -v -ldflags " ${LD_FLAGS} " -o ./bin/binance-proxy ./cmd/binance-proxy/* .go
31
+ @chmod +x ./bin/*
32
+
33
+ .PHONY : run
34
+ run : # ## Quick run
35
+ @CGO_ENABLED=1 go run -race cmd/binance-proxy/* .go
36
+
37
+ .PHONY : deps
38
+ deps : # ## Optimize dependencies
39
+ @go mod tidy
40
+
41
+ .PHONY : vendor
42
+ vendor : # ## Vendor dependencies
43
+ @go mod vendor
44
+
45
+ .PHONY : install
46
+ install : # ## Install binary in your system
47
+ @go install -v cmd/binance-proxy/* .go
48
+
49
+ .PHONY : fmt
50
+ fmt : # ## Format
51
+ @gofmt -s -w .
52
+
53
+ .PHONY : vet
54
+ vet : # ## Vet
55
+ @go vet ./...
56
+
57
+ # ## Lint
58
+ .PHONY : lint
59
+ lint : fmt vet
60
+
61
+ # ## Clean test
62
+ .PHONY : test-clean
63
+ test-clean : # ## Clean test cache
64
+ @go clean -testcache ./...
65
+
66
+ .PHONY : test
67
+ test : lint # ## Run tests
68
+ @go test -v -coverprofile=cover.out -timeout 10s ./...
69
+
70
+ .PHONY : cover
71
+ cover : test # ## Run tests and generate coverage
72
+ @go tool cover -html=cover.out -o=cover.html
You can’t perform that action at this time.
0 commit comments