Skip to content

Commit

Permalink
build: test with -race and -cover
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Aug 5, 2019
1 parent ad44ce0 commit c20ec51
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
39 changes: 27 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: 2
version: 2.1

orbs:
codecov: codecov/[email protected]
moul: moul/[email protected]
tools: gotest/[email protected]


jobs:
build:
docker:
Expand All @@ -9,15 +16,23 @@ jobs:
GOPROXY: "https://goproxy.io"
steps:
- checkout
# - restore_cache:
# keys:
# - go-mod-v1-{{ arch }}-{{ checksum "go.sum" }}
# - go-mod-v1-{{ arch }}-
- run: go mod download
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- go-mod-v1-
- tools/mod-download
- tools/mod-tidy-check
- run: make test
- run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- v1.17.1
- run: PATH=$PATH:./bin make lint
# - save_cache:
# key: go-mod-v1-{{ arch }}-{{ checksum "go.sum" }}
# paths:
# - /go/pkg/mod
- moul/install_golangci-lint
- run: make lint
- codecov/upload:
file: coverage.txt
- save_cache:
key: go-mod-v1-{{ checksum "go.sum" }}
paths:
- /go/pkg/mod

workflows:
main:
jobs:
- build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
[._]ss[a-gi-z]
[._]sw[a-p]

coverage.txt

# osx
.DS_Store

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ lint:

.PHONY: test
test:
go test -v ./...
go test -race -covermode=atomic -coverpkg=all -coverprofile=coverage.txt -cover -v ./...
cd example && go test -v ./...
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ require (
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 // indirect
golang.org/x/net v0.0.0-20190611141213-3f473d35a33a // indirect
golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae // indirect
google.golang.org/appengine v1.4.0 // indirect
)

0 comments on commit c20ec51

Please sign in to comment.