@@ -11,55 +11,60 @@ jobs:
1111 build :
1212 runs-on : ubuntu-latest
1313 steps :
14- - uses : actions/checkout@v2
15-
1614 - name : Set up Go
17- uses : actions/setup-go@v2
15+ uses : actions/setup-go@v6
1816 with :
19- go-version : 1.17
17+ go-version : 1.25
2018
21- - name : OVS setup
19+ - name : Set up OVS
2220 run : |
2321 sudo apt-get update
2422 sudo apt install openvswitch-switch
2523 sudo ovs-vsctl add-br ovsbr0
26-
27- - name : Check and test
28- run : |
29- export GOPATH=/home/runner/work
30- export PATH=$PATH:$GOPATH/bin
31- mkdir $GOPATH/src $GOPATH/pkg $GOPATH/bin
32- go install honnef.co/go/tools/cmd/staticcheck@2020.2.1
33- NEW=$GOPATH/src/github.com/digitalocean/go-openvswitch
34- mkdir -p $NEW
35- cp -r ./* $NEW
36- cd $NEW
37- go mod download
38- go get golang.org/x/lint/golint
39- go get -d ./...
24+
25+ - uses : actions/checkout@v5
26+
27+ - name : License check
28+ run : |
4029 echo "=========START LICENSE CHECK============"
4130 ./scripts/licensecheck.sh
42- echo "=========START BUILD============"
43- go build -v -tags=gofuzz ./...
44- echo "=========START VET============"
31+
32+ - name : Download deps
33+ run : go mod download
34+
35+ - name : Lint
36+ run : |
37+ # install tools
38+ go install honnef.co/go/tools/cmd/staticcheck@latest
39+ go install golang.org/x/lint/golint@latest
40+ go install github.com/mgechev/revive@latest
41+
4542 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============"
43+
44+ GOFMT=$(gofmt -l .)
45+ if [[ -n $GOFMT ]]; then
46+ echo -e "Files that are not gofmt'd:\n"
47+ echo "$GOFMT"
48+ exit 1
49+ fi
50+
51+ revive ./...
52+
5153 staticcheck ./...
52- echo "=========START LINT============"
53- golint -set_exit_status ./cmd/... ./internal/...
54+
55+ - name : Run Gosec Security Scanner
56+ uses : securego/gosec@master
57+ with :
58+ args : -exclude=G115 ./...
59+
60+ - name : Build
61+ run : go build -v ./...
62+
63+ - name : Test
64+ run : |
5465 echo "=========START TESTS IN OVS============"
5566 go test -v -race -short ./ovs/
5667 echo "=========START TESTS IN OVSDB============"
57- go test -v -race ./ovsdb/
58- go test -c -race ./ovsdb
68+ sudo go test -v -race ./ovsdb/
5969 echo "=========START TESTS IN OVSNL============"
6070 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