-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CircleCI config, fix one comment on VM map to fix lint warning
- Loading branch information
Showing
2 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
version: 2 | ||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- clean-code | ||
- test: | ||
requires: | ||
- clean-code | ||
- race: | ||
requires: | ||
- clean-code | ||
- compile: | ||
requires: | ||
- clean-code | ||
jobs: | ||
clean-code: | ||
docker: | ||
- image: circleci/golang:latest | ||
steps: | ||
- checkout | ||
- run: | ||
name: Go mod verify | ||
command: go mod verify | ||
- run: | ||
name: Go mod graph | ||
command: go mod graph | ||
- run: | ||
name: Run go vet | ||
command: go vet ./cmd/hkmgr ./internal/... | ||
- run: | ||
name: Run revive | ||
command: | | ||
go get -u github.com/mgechev/revive | ||
test -z "$(revive -exclude=vendor/... ./... | grep -v 'should have comment or be unexported')" | ||
- run: | ||
name: gofmt | ||
command: test -z "$(gofmt -s -l cmd internal)" | ||
test: | ||
docker: | ||
- image: circleci/golang:latest | ||
environment: | ||
- CGO_ENABLED: 0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Test all | ||
command: go test -mod=vendor -a -ldflags '-s' ./... | ||
- run: | ||
name: Test coverage | ||
command: go test -mod=vendor -cover ./... | ||
race: | ||
docker: | ||
- image: circleci/golang:latest | ||
environment: | ||
- CGO_ENABLED: 1 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Race detector | ||
command: go test -mod=vendor -race ./... | ||
compile: | ||
docker: | ||
- image: circleci/golang:latest | ||
environment: | ||
- CGO_ENABLED: 0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: build all tools | ||
command: | | ||
go build -mod=vendor -a -ldflags '-s' ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters