diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index de485ef3..583c35d9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,46 +3,50 @@ on: push: paths: - 'daemon/*' + - '.github/workflows/go.yml' pull_request: paths: - 'daemon/*' -jobs: + - '.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.15 + uses: actions/setup-go@v1 + with: + go-version: 1.15 + id: go - - name: Set up Go 1.15 - uses: actions/setup-go@v1 - with: - go-version: 1.15 - id: go + - name: Check out code into the Go module directory + uses: actions/checkout@v2 - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + - 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 get github.com/golang/protobuf/protoc-gen-go + go install google.golang.org/protobuf/cmd/protoc-gen-go + go get google.golang.org/grpc/cmd/protoc-gen-go-grpc + cd proto + make ../daemon/ui/protocol/ui.pb.go + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi - - 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 get github.com/golang/protobuf/protoc-gen-go - go install google.golang.org/protobuf/cmd/protoc-gen-go - go get google.golang.org/grpc/cmd/protoc-gen-go-grpc - cd proto - make ../daemon/ui/protocol/ui.pb.go - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: | - cd daemon - go build -v . - - name: Test - run: | - cd daemon - go test ./... + - name: Build + run: | + cd daemon + go build -v . + - name: Test + run: | + cd daemon + go test ./...