Skip to content

Commit

Permalink
Merge pull request #2 from gostaticanalysis/add-workflow
Browse files Browse the repository at this point in the history
Create testandvet.yml
  • Loading branch information
tenntenn authored Jul 11, 2021
2 parents 0a9d60b + 40ab6b1 commit d9c562f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/testandvet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test and Vet

on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
- created
- edited

defaults:
run:
shell: bash

jobs:
test:
runs-on: ubuntu-20.04

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x

- name: Checkout code
uses: actions/checkout@v2

- name: Cache Go module and build cache
uses: actions/cache@v2
with:
key: go-${{ hashFiles('**/go.sum') }}
path: |
~/go/pkg/mod
restore-keys: |
go-
- name: Install tennvet
run: |
GOBIN=$(pwd) go install github.com/tenntenn/tennvet@latest
- name: Test and vet
run: |
go vet ./...
go vet -vettool=$(pwd)/tennvet ./...
go test -v -race ./...
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ import (
)

func main() { unitchecker.Main(fieldtype.Analyzer) }

2 changes: 1 addition & 1 deletion passes/fieldtype/fieldtype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package fieldtype_test
import (
"testing"

"github.com/gostaticanalysis/zapvet/passes/fieldtype"
"github.com/gostaticanalysis/testutil"
"github.com/gostaticanalysis/zapvet/passes/fieldtype"
"golang.org/x/tools/go/analysis/analysistest"
)

Expand Down

0 comments on commit d9c562f

Please sign in to comment.