-
Notifications
You must be signed in to change notification settings - Fork 10
74 lines (63 loc) · 1.78 KB
/
static-analysis.yaml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Static Analysis and Report
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch: {}
jobs:
analyze:
name: Static analysis
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: Run unit tests
run: go test -race -count=1 -vet=off -coverprofile=./cov.out ./...
- name: Run gosec Security Scanner
continue-on-error: true
uses: securego/gosec@master
with:
args: -exclude-dir=testdata -exclude-dir=test -exclude-dir=blocktx/store/sql -exclude-generated -fmt=sonarqube -out gosec-report.json ./...
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
staticcheck:
name: Static check
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: "./go.mod"
- name: staticcheck
uses: dominikh/[email protected]
with:
version: "2023.1.6"
install-go: false
lint:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: "./go.mod"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.60.1