-
Notifications
You must be signed in to change notification settings - Fork 15
48 lines (41 loc) · 1.08 KB
/
code-quality.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
name: Code quality checks
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
GOOS: linux
GO111MODULE: on
jobs:
resolve-modules:
name: Resolve Modules
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- id: set-matrix
run: ./utils/golangci-lint/resolve-modules.sh
golangci:
name: GolangCI Lint
needs: resolve-modules
runs-on: ubuntu-20.04
strategy:
matrix: { dir: ['cmd', 'pkg', 'tools/plotter'] }
fail-fast: false
steps:
- name: Setup Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Install dependencies for cgo
run: sudo apt update && sudo apt install libsnmp-dev
- name: Checkout code into go module directory
uses: actions/checkout@v3
- name: Lint with golangci-lint
uses: golangci/[email protected]
with:
working-directory: ${{ matrix.dir }}
args: --timeout 5m