-
Notifications
You must be signed in to change notification settings - Fork 18
87 lines (82 loc) · 2.32 KB
/
golangci.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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Golang CI
on:
push:
branches:
- master
- dev
paths:
- "**.go"
- "go.mod"
- "go.sum"
- ".github/workflows/golangci.yml"
pull_request:
paths:
- "**.go"
- "go.mod"
- "go.sum"
- ".github/workflows/golangci.yml"
concurrency:
group: nuvola-ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
security-events: write
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
# v4.1.4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
# v5.0.0
with:
go-version: "oldstable"
- name: golangci-lint
uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc
# v5.1.0
with:
version: latest
only-new-issues: true
args: --timeout 300s --exclude-dirs="(^|/)assets($|/)" --enable misspell --enable gofmt --enable goimports --enable whitespace
gosec:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
# v4.1.4
- name: Run Gosec Security Scanner
# master to fetch latest checks
# kics-scan ignore-line
uses: securego/gosec@6fbd381238e97e1d1f3358f0d6d65de78dcf9245
# V.2.20.0
with:
args: "-exclude-dir=assets -no-fail -fmt sarif -out results.sarif ./..."
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@4b6aa0b07da05d6e43d0e5f9c8596a6532ce1c85
# v2.15.3
with:
sarif_file: ./results.sarif
go-build-and-test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
# v4.1.4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
# v5.0.0
with:
go-version-file: "go.mod"
cache-dependency-path: |
go.sum
- name: Install dependencies
run: go get .
- name: Build
run: go build ./...
- name: Test with the Go CLI
run: go test ./...