-
Notifications
You must be signed in to change notification settings - Fork 95
38 lines (31 loc) · 1.12 KB
/
pr-static-code-analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Run Static Code Analysis
# This workflow uses golangci-lint to run static code analysis on PRs
# In addition to default golanci-linters checks vulnerability checks (gosec),
# closing of openend http bodies (bodyclose), cyclomatic complexity (cyclop),
# exhaustive switches (exhaustive) and open TODO/FIXME comments (godox)
on:
pull_request:
branches: [ main ]
jobs:
verify:
name: Verify
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- name: 🛠️ Set up Go 1.x
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0
with:
go-version: '~1.20'
- name: ⬇️ Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
- name: ✍️ Check format
run: make lint
- name: 🕵️ Go vet
run: make vet
- name: 🔎 golangci-lint
uses: reviewdog/action-golangci-lint@24d4af2fc93f5b2b296229e8b0c0f658d25707af #v2.4.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check