From 4750a072e46b101f62098077026682a764ce3e46 Mon Sep 17 00:00:00 2001 From: Long Date: Tue, 26 Jan 2021 18:42:35 +0530 Subject: [PATCH] added github-actions CI --- .github/workflows/go.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..4d745aa --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,31 @@ +name: Go + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build: + strategy: + matrix: + go-versions: [1.12.x, 1.13.x, 1.14.x] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-versions }} + - name: Install + run: GO111MODULE=off go get golang.org/x/lint/golint + - name: Run gofmt + run: diff -u <(echo -n) <(gofmt -d *.go) + - name: Run golint + run: diff -u <(echo -n) <(golint $(go list -e ./...) | grep -v YAMLToJSON) + - name: Run go vet + run: GO111MODULE=on go vet . + - name: Run go test + run: GO111MODULE=on go test -v -race ./... + - name: Check diff + run: git diff --exit-code