Merge pull request #42 from digitalocean/varsha/circleci

Setup CircleCI for clusterlint
image-warning-sha256
Varsha Varadarajan 2019-07-16 12:56:12 -04:00 committed by GitHub
commit 6aab133796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 42 deletions

39
.circleci/config.yml Normal file
View File

@ -0,0 +1,39 @@
version: 2
jobs:
license:
docker:
- image: golang:1.12.6
steps:
- checkout
- run: ./script/check-licenses.sh
vet:
environment:
GOFLAGS: "-mod=vendor"
docker:
- image: golang:1.12.6
steps:
- checkout
- run: go vet ./...
lint:
docker:
- image: golang:1.12.6
steps:
- checkout
- run: go get golang.org/x/lint/golint
- run: sh -c golint -set_exit_status $(go list ./...)
test:
environment:
GOFLAGS: "-mod=vendor"
docker:
- image: golang:1.12.6
steps:
- checkout
- run: go test -race -cover ./...
workflows:
version: 2
all:
jobs:
- license
- vet
- lint
- test

View File

@ -1,2 +0,0 @@
FROM golang:1.12.6
RUN go get golang.org/x/lint/golint

40
.github/main.workflow vendored
View File

@ -1,40 +0,0 @@
workflow "Pull Request" {
# TODO(awg): This won't run checks on PRs from forks. For now that seems to be
# a limitation of GH actions.
on = "push"
resolves = [
"vet",
"lint",
"test",
"check-licenses",
]
}
action "vet" {
uses = "docker://golang:1.12.6"
env = {
GOFLAGS = "-mod=vendor"
}
runs = ["go", "vet", "./..."]
}
action "lint" {
uses = "./.github/golint"
env = {
GOFLAGS = "-mod=vendor"
}
runs = ["sh", "-c", "golint -set_exit_status $(go list ./...)"]
}
action "test" {
uses = "docker://golang:1.12.6"
env = {
GOFLAGS = "-mod=vendor"
}
runs = ["go", "test", "-race", "-cover", "./..."]
}
action "check-licenses" {
uses = "docker://golang:1.12.6"
runs = ["./script/check-licenses.sh"]
}