Skip to content

Commit

Permalink
Add CircleCI config, fix one comment on VM map to fix lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
bensallen committed Dec 22, 2019
1 parent 5dc5c89 commit 193d69a
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .circleci/config.yml
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' ./...
2 changes: 1 addition & 1 deletion internal/config/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

var hyperkitPath = "hyperkit"

// VMs
// VM is the map of VM names to VMConfig
type VM map[string]*VMConfig

type VMConfig struct {
Expand Down

0 comments on commit 193d69a

Please sign in to comment.