From 67ccd83579c48739270eafa6995d7864d7f80eae Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 12:50:27 +0300 Subject: [PATCH] ci: integrate GitHub Actions --- .github/workflows/go.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 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..de59f36 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,41 @@ +name: Go +on: [push] +jobs: + + test: + name: test + runs-on: ubuntu-latest + strategy: + matrix: + go: [ '1.11.x', '1.12.x', '1.13.x'] + steps: + + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Set GOPATH + # temporary fix + # see https://github.com/actions/setup-go/issues/14 + run: | + echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)" + echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin" + shell: bash + + - name: Get dependencies + run: | + go get -u -v golang.org/x/lint/golint + go mod tidy -v + + - name: Linter + run: golint -set_exit_status ./... + + - name: Tests + run: go test -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Codecov + run: bash <(curl -s https://codecov.io/bash)