Skip to content

Merge pull request #140 from digitalocean/anitgandhi/update-go-ci #132

Merge pull request #140 from digitalocean/anitgandhi/update-go-ci

Merge pull request #140 from digitalocean/anitgandhi/update-go-ci #132

Workflow file for this run

name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 1.25
- name: Set up OVS
run: |
sudo apt-get update
sudo apt install openvswitch-switch
sudo ovs-vsctl add-br ovsbr0
- uses: actions/checkout@v5
- name: License check
run: |
echo "=========START LICENSE CHECK============"
./scripts/licensecheck.sh
- name: Download deps
run: go mod download
- name: Lint
run: |
# install tools
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/lint/golint@latest
go install github.com/mgechev/revive@latest
go vet ./...
GOFMT=$(gofmt -l .)
if [[ -n $GOFMT ]]; then
echo -e "Files that are not gofmt'd:\n"
echo "$GOFMT"
exit 1
fi
revive ./...
staticcheck ./...
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: -exclude=G115 ./...
- name: Build
run: go build -v ./...
- name: Test
run: |
echo "=========START TESTS IN OVS============"
go test -v -race -short ./ovs/
echo "=========START TESTS IN OVSDB============"
sudo go test -v -race ./ovsdb/
echo "=========START TESTS IN OVSNL============"
go test -v -race ./ovsnl/