Merge pull request #6 from suzerain-io/add-golangci-lint-action

Add golangci-lint as a GitHub Action.
This commit is contained in:
Matt Moyer 2020-07-08 13:16:17 -05:00 committed by GitHub
commit 1c7109d5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 42 additions and 0 deletions

42
.github/workflows/pull-request-ci.yml vendored Normal file
View File

@ -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 ./...