This repository was archived by the owner on Mar 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +48
-5
lines changed
Expand file tree Collapse file tree 2 files changed +48
-5
lines changed Original file line number Diff line number Diff line change 1+ name : Tests and Linters
2+
3+ on :
4+ push :
5+ pull_request :
6+ workflow_dispatch :
7+
8+ jobs :
9+ Linters :
10+ runs-on : ubuntu-latest
11+ timeout-minutes : 10
12+ steps :
13+ - uses : actions/checkout@v4
14+ with :
15+ ref : master
16+ - name : Setup go
17+ uses : actions/setup-go@v5
18+ with :
19+ go-version : 1.23
20+ - name : Install dependencies
21+ run : make deps
22+ - name : Run linters
23+ run : make lint
24+
25+ Tests :
26+ runs-on : ubuntu-latest
27+ timeout-minutes : 10
28+ steps :
29+ - uses : actions/checkout@v4
30+ with :
31+ ref : master
32+ - name : Setup go
33+ uses : actions/setup-go@v5
34+ with :
35+ go-version : 1.23
36+ - name : Run tests
37+ run : make test
38+ - name : Report stats
39+ run : make analyse
40+
Original file line number Diff line number Diff line change 77bench :
88 go test -cover -test.benchmem -bench=.
99
10- # Generate pretty coverage report
11- analyse :
12- go tool cover -html=" .cover.out" -o=" cover.html"
13- gocyclo -avg -top 10 .
14-
1510# Runs source code linters and catches common errors
1611lint :
1712 test -z $$(gofmt -l . ) || (echo " Code isn't gofmt'ed!" && exit 1)
1813 go vet $$(go list ./... | grep -v /tmp )
1914 gosec -quiet -fmt=golint -exclude-dir=" tmp" ./...
2015
16+ # Generate pretty coverage report
17+ analyse :
18+ go tool cover -html=" .cover.out" -o=" cover.html"
19+ @echo -e " \nCOVERAGE\n===================="
20+ go tool cover -func=.cover.out
21+ @echo -e " \nCYCLOMATIC COMPLEXITY\n===================="
22+ gocyclo -avg -top 10 .
23+
2124# Updates 3rd party packages and tools
2225deps :
2326 go get -u $$(go list ./... | grep -v /tmp )
You can’t perform that action at this time.
0 commit comments