From 824ac43a4c0f6f47e54acebffb09dcce0c27f561 Mon Sep 17 00:00:00 2001 From: Brad Van Vugt <1531419+bvanvugt@users.noreply.github.com> Date: Wed, 1 Jan 2020 17:30:57 -0800 Subject: [PATCH] Add CI. --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..09dddfb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: [push] + +jobs: + + format: + name: Format (gofmt) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-go@master + with: + go-version: '1.13' + - name: gofmt + run: test -z $(gofmt -l .) || (gofmt -d . && exit 1) + + lint: + name: Lint (golangci-lint) + runs-on: ubuntu-latest + needs: [format] + steps: + - uses: actions/checkout@master + - uses: actions/setup-go@master + with: + go-version: '1.13' + - name: golangci-lint + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.22.2 + cd src + ../bin/golangci-lint run -v ./... + + test: + name: Test (go test) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-go@master + with: + go-version: '1.13' + - name: go test + run: go test ./...