-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.05 KB
/
linter.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
39
40
41
42
43
44
name: linter
on:
workflow_call:
push:
branches:
- master
pull_request:
branches:
- master
permissions: read-all
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.19'
- name: Clone repository
uses: actions/checkout@v2
- name: Cache dependencies
id: cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-
- name: Download dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
go mod download
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=10m --issues-exit-code=0
- name: Run Gosec Security Scanner
run: |
wget -O - -q https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.18.2
./bin/gosec ./...
- name: Run tests
run: go test -race -v ./...