Merge pull request #29 from digitalocean/awg/ci

Add basic CI checks using GH actions
varsha/versions
Varsha Varadarajan 2019-06-28 08:10:21 -04:00 committed by GitHub
commit a9460b1dc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

2
.github/golint/Dockerfile vendored Normal file
View File

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

34
.github/main.workflow vendored Normal file
View File

@ -0,0 +1,34 @@
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",
]
}
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", "./..."]
}