diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml new file mode 100644 index 000000000..77cd68629 --- /dev/null +++ b/.github/workflows/config.yml @@ -0,0 +1,19 @@ +on: + pull_request: + branches: + - master + +jobs: + unit_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.12 + - name: Download Go Packages + run: | + make deps + - name: Run Go Tests + run: | + make check diff --git a/Makefile b/Makefile index 812cb702c..75785783c 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,11 @@ BUILD ?=$(shell git rev-parse --short HEAD) PKG ?=github.com/commitdev/zero BUILD_ARGS=-v -ldflags=all="-X ${PKG}/cmd.appVersion=${VERSION} -X ${PKG}/cmd.appBuild=${BUILD}" +deps: + go mod download + check: - go test ./... + go list -f '{{.Dir}}' ./... | grep -v /tmp/ | xargs go test -v fmt: go fmt ./... diff --git a/go.mod b/go.mod index 6940f00b3..d89cfb6c8 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect github.com/coreos/go-semver v0.2.0 + github.com/google/go-cmp v0.3.0 github.com/google/uuid v1.1.1 github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.7.3