...
1name: build
2
3on:
4 push:
5 branches:
6 - main
7 pull_request:
8 types: [opened, synchronize, reopened]
9
10jobs:
11 check:
12 runs-on: ubuntu-latest
13 steps:
14 - name: Checkout
15 uses: actions/checkout@v3
16 - uses: reviewdog/action-staticcheck@v1
17 with:
18 github_token: ${{ secrets.github_token }}
19 reporter: github-pr-review
20 filter_mode: nofilter
21 fail_on_error: true
22
23 build:
24 runs-on: ubuntu-latest
25 strategy:
26 fail-fast: false
27 matrix:
28 go: [1.17, 1.18, 1.19]
29 steps:
30 - name: Checkout
31 uses: actions/checkout@v3
32 - name: Setup Go
33 uses: actions/setup-go@v3
34 with:
35 go-version: "${{ matrix.go }}"
36 check-latest: true
37 cache: true
38 - name: Check Go code formatting
39 run: |
40 if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
41 gofmt -s -l .
42 echo "Please format Go code by running: go fmt ./..."
43 exit 1
44 fi
45 - name: Build
46 run: |
47 go install github.com/mfridman/tparse@latest
48 go vet ./...
49 go test -v -race -count=1 -json -coverpkg=$(go list ./...) ./... | tparse -follow -notests
50 go build ./...
View as plain text