From 518ae7eb4cd4fb94a0deb1869acdd6b44f85ecbb Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Wed, 8 Jul 2020 12:41:18 -0500 Subject: [PATCH] Add golangci-lint and go test as GitHub Actions. Signed-off-by: Matt Moyer --- .github/workflows/pull-request-ci.yml | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/pull-request-ci.yml diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml new file mode 100644 index 00000000..24a50119 --- /dev/null +++ b/.github/workflows/pull-request-ci.yml @@ -0,0 +1,42 @@ +name: CI +on: + push: + tags: + - v* + branches: + - master + pull_request: + +jobs: + golangci: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v1 + with: + version: v1.28 + + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.14 + uses: actions/setup-go@v2 + with: + go-version: ^1.14 + id: go + - name: Checkout + uses: actions/checkout@v2 + - name: Cache Dependencies + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Build + run: go build -v ./... + - name: Test + run: go test -cover ./...