1
+ name : Go
2
+
3
+ on :
4
+ push :
5
+ branches : [ master ]
6
+ pull_request :
7
+ branches : [ master ]
8
+
9
+ jobs :
10
+
11
+ build :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+
16
+ - name : Set up Go
17
+ uses : actions/setup-go@v2
18
+ with :
19
+ go-version : 1.17
20
+
21
+ - name : OVS setup
22
+ run : |
23
+ sudo apt install openvswitch-switch
24
+ sudo ovs-vsctl add-br ovsbr0
25
+
26
+ - name : Check and test
27
+ run : |
28
+ export GOPATH=/home/runner/work
29
+ export PATH=$PATH:$GOPATH/bin
30
+ mkdir $GOPATH/src $GOPATH/pkg $GOPATH/bin
31
+ go install honnef.co/go/tools/cmd/staticcheck@latest
32
+ NEW=$GOPATH/src/github.com/digitalocean/go-openvswitch
33
+ mkdir -p $NEW
34
+ cp -r ./* $NEW
35
+ cd $NEW
36
+ go mod download
37
+ go get golang.org/x/lint/golint
38
+ go get honnef.co/go/tools/cmd/staticcheck
39
+ go get -d ./...
40
+ echo "=========START LICENSE CHECK============"
41
+ ./scripts/licensecheck.sh
42
+ echo "=========START BUILD============"
43
+ go build -v -tags=gofuzz ./...
44
+ echo "=========START VET============"
45
+ go vet ./...
46
+ echo "=========START GO FMT CHECK============"
47
+ ./scripts/gofmt.sh
48
+ echo "=========START GO LINT CHECK============"
49
+ ./scripts/golint.sh
50
+ echo "=========START STATICCHECK============"
51
+ staticcheck ./...
52
+ echo "=========START LINT============"
53
+ golint -set_exit_status ./cmd/... ./internal/...
54
+ echo "=========START TESTS IN OVS============"
55
+ go test -v -race ./ovs/
56
+ echo "=========START TESTS IN OVSDB============"
57
+ go test -v -race ./ovsdb/
58
+ go test -c -race ./ovsdb
59
+ echo "=========START TESTS IN OVSNL============"
60
+ go test -v -race ./ovsnl/
61
+ echo "=========START OVSDB.TEST============"
62
+ sudo ./ovsdb.test -test.v
63
+ echo "=========START SECURITY SCANNING============"
64
+ go install github.com/praetorian-inc/gokart@latest
65
+ gokart scan
0 commit comments