| 1 |
name: Static Analysis |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- "*" |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- "*" |
| 10 |
|
| 11 |
jobs: |
| 12 |
build: |
| 13 |
strategy: |
| 14 |
matrix: |
| 15 |
go-version: ["1.20"] |
| 16 |
runs-on: ubuntu-latest |
| 17 |
|
| 18 |
steps: |
| 19 |
- name: Set up Go |
| 20 |
uses: actions/setup-go@v3 |
| 21 |
with: |
| 22 |
go-version: ${{ matrix.go-version }} |
| 23 |
id: go |
| 24 |
|
| 25 |
- name: Check out code into the Go module directory |
| 26 |
uses: actions/checkout@v3 |
| 27 |
|
| 28 |
- name: Install staticcheck |
| 29 |
run: go install honnef.co/go/tools/cmd/staticcheck@latest |
| 30 |
|
| 31 |
- name: Print staticcheck version |
| 32 |
run: staticcheck -version |
| 33 |
|
| 34 |
- name: Run staticcheck |
| 35 |
run: staticcheck ./... |
| 36 |
|
| 37 |
- name: Run go vet |
| 38 |
run: go vet ./... |