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