2020-02-25 22:23:09 +01:00
|
|
|
name: Build status
|
2022-10-05 14:13:03 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
2022-10-23 11:49:22 +02:00
|
|
|
- 'daemon/**'
|
2022-10-18 23:59:44 +02:00
|
|
|
- '.github/workflows/go.yml'
|
2022-10-05 14:13:03 +02:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2022-10-23 11:49:22 +02:00
|
|
|
- 'daemon/**'
|
2022-10-18 23:59:44 +02:00
|
|
|
- '.github/workflows/go.yml'
|
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
2020-02-23 08:52:48 +01:00
|
|
|
|
2022-10-18 23:59:44 +02:00
|
|
|
jobs:
|
2020-02-23 08:52:48 +01:00
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-23 20:32:29 +02:00
|
|
|
- name: Set up Go 1.20.10
|
2023-02-01 11:31:13 -05:00
|
|
|
uses: actions/setup-go@v3
|
2022-10-18 23:59:44 +02:00
|
|
|
with:
|
2023-10-23 20:32:29 +02:00
|
|
|
go-version: 1.20.10
|
2022-10-18 23:59:44 +02:00
|
|
|
id: go
|
2020-02-23 08:52:48 +01:00
|
|
|
|
2022-10-18 23:59:44 +02:00
|
|
|
- name: Check out code into the Go module directory
|
2023-02-01 11:31:13 -05:00
|
|
|
uses: actions/checkout@v3
|
2020-02-23 08:52:48 +01:00
|
|
|
|
2022-10-18 23:59:44 +02:00
|
|
|
- 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
|
2023-10-23 20:32:29 +02:00
|
|
|
go install github.com/golang/protobuf/protoc-gen-go@latest
|
|
|
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
|
|
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
2022-10-18 23:59:44 +02:00
|
|
|
cd proto
|
|
|
|
make ../daemon/ui/protocol/ui.pb.go
|
2023-10-23 20:32:29 +02:00
|
|
|
cd ../daemon
|
|
|
|
go mod tidy; go mod vendor
|
2020-02-23 08:52:48 +01:00
|
|
|
|
2022-10-18 23:59:44 +02:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd daemon
|
|
|
|
go build -v .
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
cd daemon
|
2023-07-06 14:40:47 +02:00
|
|
|
sudo PRIVILEGED_TESTS=1 NETLINK_TESTS=1 go test ./...
|