tmp #513
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: sudo 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 python3-pipx | |
- name: Install snmpsim | |
run: sudo 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: sudo 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@v5 |