Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ubuntu + go + libs #71

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,70 @@ permissions:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
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-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
go-version: '^1.23'
- name: Build
run: go build -tags=nonetsnmp ./cmd/snmp-proxy

test:
name: Test
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev python3-pip snmp-mibs-downloader
run: sudo apt update && sudo apt install libsnmp-dev pipx snmp-mibs-downloader
- name: Install snmpsim
run: sudo pip3 install snmpsim
run: pipx install snmpsim
- name: Run tests
run: make test

test-no-netsnmp:
name: Test without netsnmp
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install python3-pip
run: sudo apt update && sudo apt install pipx
- name: Install snmpsim
run: sudo pip3 install snmpsim
run: pipx install snmpsim
- name: Run tests
run: GO_TEST_FLAGS=-tags=nonetsnmp make test

coverage:
name: Code Coverage
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev python3-pip snmp-mibs-downloader
run: sudo apt update && sudo apt install libsnmp-dev pipx snmp-mibs-downloader
- name: Install snmpsim
run: sudo pip3 install snmpsim
run: pipx install snmpsim
- name: Download go-acc
run: go install github.com/ory/go-acc@latest
- name: Generate Code Coverage
Expand All @@ -86,13 +86,13 @@ jobs:

lint:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
uses: golangci/golangci-lint-action@v6
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
go-version: '^1.23'
- name: Install dependencies
run: sudo apt update && sudo apt install libsnmp-dev
- name: GoReleaser
Expand Down
17 changes: 12 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ linters: # 2022-07-21 modified
- durationcheck
- errorlint
- exhaustive
- exportloopref
- gci
- gochecknoglobals
- gochecknoinits
- gocognit # probably tune
- goconst
- gocritic # probably tune
- godot
- goerr113
- err113
- gofumpt
- gosec
# - ifshort # not yet mature, has some bugs
Expand Down Expand Up @@ -57,7 +56,15 @@ linters-settings:
- fieldalignment # @todo fix later

gosec:
excludes: [G501, G502, G503, G504, G505] # ignore imports, usages are still reported
excludes:
# https://github.com/securego/gosec/issues/1185
- G115
# ignore imports, usages are still reported
- G501
- G502
- G503
- G504
- G505

revive: # v1.2.3
ignoreGeneratedHeader: true
Expand Down Expand Up @@ -149,9 +156,9 @@ issues:
- path: _test\.go
text: assignments should only be cuddled with other assignments
linters: [wsl]
# ignore goerr113 dynamic errors definition error...not sure how to approach this correctly now
# ignore err113 dynamic errors definition error...not sure how to approach this correctly now
- text: do not define dynamic errors, use wrapped static errors instead
linters: [goerr113]
linters: [err113]

output:
sort-results: true
35 changes: 18 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
module github.com/grongor/go-snmp-proxy

go 1.22
go 1.23

require (
github.com/TheZeroSlave/zapsentry v1.23.0
github.com/gosnmp/gosnmp v1.37.0
github.com/gosnmp/gosnmp v1.38.0
github.com/grongor/panicwatch v1.2.0
github.com/prometheus/client_golang v1.19.0
github.com/spf13/viper v1.18.2
github.com/prometheus/client_golang v1.20.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
golang.org/x/sys v0.19.0
golang.org/x/sys v0.24.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/getsentry/sentry-go v0.28.1 // indirect
github.com/glycerine/rbuf v0.0.0-20190314090850-75b78581bebe // indirect
github.com/go-errors/errors v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading