Skip to content

Commit ad59757

Browse files
committed
Add static analysis workflow
1 parent b2f2792 commit ad59757

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Static Analysis
2+
on:
3+
push:
4+
branches: [ main, develop ]
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
static-analysis:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version: 1.23
16+
17+
- name: Install lint tools
18+
run: |
19+
go install golang.org/x/lint/golint@latest
20+
go install github.com/gordonklaus/ineffassign@latest
21+
go install github.com/client9/misspell/cmd/misspell@latest
22+
23+
- name: Check gofmt
24+
run: test -z "$(gofmt -l .)" || (echo "Code is not gofmt'ed" && exit 1)
25+
26+
- name: Run go vet
27+
run: go vet ./...
28+
29+
- name: Run golint
30+
run: golint ./... | tee lint.out && test ! -s lint.out
31+
32+
- name: Run ineffassign
33+
run: ineffassign .
34+
35+
- name: Run misspell
36+
run: misspell -error .

0 commit comments

Comments
 (0)