From 07a63a4a1213ac5ea80618c410d2898123f6eaaa Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Thu, 27 Jun 2019 16:12:03 -0600 Subject: [PATCH] Add basic CI checks using GH actions --- .github/golint/Dockerfile | 2 ++ .github/main.workflow | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/golint/Dockerfile create mode 100644 .github/main.workflow diff --git a/.github/golint/Dockerfile b/.github/golint/Dockerfile new file mode 100644 index 0000000..c3167af --- /dev/null +++ b/.github/golint/Dockerfile @@ -0,0 +1,2 @@ +FROM golang:1.12.6 +RUN go get golang.org/x/lint/golint diff --git a/.github/main.workflow b/.github/main.workflow new file mode 100644 index 0000000..5f3852a --- /dev/null +++ b/.github/main.workflow @@ -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", "./..."] +}