opensnitch/.github/workflows/go.yml
Gustavo Iñiguez Goia 86f0bea18d
updated workflow compilation deps
google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2 generates
protobuffers incompatible with go1.17, it fails with the error:
"ui/protocol/ui.pb.go:2716:47: predeclared any requires go1.18 or later
(-lang was set to go1.17; check go.mod)"

Notes:
 - consider using go1.18 as min required version if there's no problem
   compiling the daemon on Debian <= 13 and other distros.
 - github.com/golang/protobuf is deprecated and we should get rid of
it.
2024-07-03 14:41:31 +02:00

49 lines
1.3 KiB
YAML

name: Build status
on:
push:
paths:
- 'daemon/**'
- '.github/workflows/go.yml'
pull_request:
paths:
- 'daemon/**'
- '.github/workflows/go.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20.10
uses: actions/setup-go@v3
with:
go-version: 1.20.10
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: |
sudo apt-get install git libnetfilter-queue-dev libmnl-dev libpcap-dev protobuf-compiler
export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin
go install github.com/golang/protobuf/protoc-gen-go@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.1
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
cd proto
make ../daemon/ui/protocol/ui.pb.go
cd ../daemon
go mod tidy; go mod vendor
- name: Build
run: |
cd daemon
go build -v .
- name: Test
run: |
cd daemon
sudo PRIVILEGED_TESTS=1 NETLINK_TESTS=1 go test ./...