Skip to content

Commit

Permalink
travis: minimal stub (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchback committed Mar 4, 2021
1 parent 7ba0632 commit 4c44105
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 21 deletions.
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: go

services:
- docker

os:
- linux

go:
- "1.16"

git:
depth: 3

cache:
directories:
- $GOPATH/pkg/mod

# Install must be set to prevent default `go get` to run.
# The dependencies have already been vendored by `dep` so
# we don't need to fetch them.
install:
-

jobs:
include:
- stage: Verify
name: "Verify code"
install:
- make install-tools
script:
- make verify

- stage: Test
name: "Run tests"
install:
- make install-tools
script:
- make tests

notifications:
email: false
67 changes: 46 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
CODE_GEN_DIR = pkg/json
GEN = pkg/cmd/codegenerator/generator.go

TCP_ADDRESS = 127.0.0.1:12345
UNIX_Address = /tmp/unix.soc


#.PHONY: build
#build:
# go build

.PHONY: generate
generate:
go run $(GEN) -s ./json/ovn-nb.ovsschema -d $(CODE_GEN_DIR)
go run $(GEN) -s ./json/ovn-sb.ovsschema -d $(CODE_GEN_DIR)
go run $(GEN) -s ./json/_server.ovsschema -d $(CODE_GEN_DIR)
gofmt -s -w $(CODE_GEN_DIR)

.PHONY: run_server
run_server:
go run pkg/cmd/server/server.go -tcp-address $(TCP_ADDRESS) -unix-address $(UNIX_Address)
.PHONY: install-tools
install-tools:
@echo "nothing for now"

VERIFY += generate
.PHONY: generate
generate: CODE_GEN_DIR = pkg/json
generate: GEN = pkg/cmd/codegenerator/generator.go
generate:
go run $(GEN) -s ./json/ovn-nb.ovsschema -d $(CODE_GEN_DIR)
go run $(GEN) -s ./json/ovn-sb.ovsschema -d $(CODE_GEN_DIR)
go run $(GEN) -s ./json/_server.ovsschema -d $(CODE_GEN_DIR)

VERIFY += fmt
.PHONY: fmt
fmt:
go fmt ./... || true

VERIFY += vet
.PHONY: vet
vet:
go vet ./... || true

VERIFY += fix
.PHONY: fix
fix:
go fix ./... || true

VERIFY += tidy
.PHONY: tidy
tidy:
go mod tidy || true

.PHONY: verify
verify: $(VERIFY)
git diff --exit-code || true

.PHONY: tests
tests:
go test ./... || true

.PHONY: server
server: TCP_ADDRESS = 127.0.0.1:12345
server: UNIX_Address = /tmp/unix.soc
server:
go run pkg/cmd/server/server.go -tcp-address $(TCP_ADDRESS) -unix-address $(UNIX_Address)

0 comments on commit 4c44105

Please sign in to comment.