-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (90 loc) · 3.06 KB
/
ci.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
pull_request:
permissions:
contents: read
checks: write
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev
- name: Build
run: go build ./cmd/snmp-proxy
build-no-netsnmp:
name: Build without netsnmp
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- name: Build
run: go build -tags=nonetsnmp ./cmd/snmp-proxy
test:
name: Test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev pipx snmp-mibs-downloader
- name: Install snmpsim
run: pipx install snmpsim
- name: Run tests
run: make test
test-no-netsnmp:
name: Test without netsnmp
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install pipx
- name: Install snmpsim
run: pipx install snmpsim
- name: Run tests
run: GO_TEST_FLAGS=-tags=nonetsnmp make test
coverage:
name: Code Coverage
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev pipx snmp-mibs-downloader
- name: Install snmpsim
run: pipx install snmpsim
- name: Download go-acc
run: go install github.com/ory/go-acc@latest
- name: Generate Code Coverage
run: GO_ACC="$(go env GOPATH)/bin/go-acc" make coverage
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.cov
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev
- name: golangci-lint
uses: golangci/golangci-lint-action@v6