1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-24 13:48:49 +08:00

dep for building vendor; no vendor in CI tests

Fixes #454
This commit is contained in:
Trevor Rosen 2017-11-04 17:26:01 -05:00
parent 0263b9c7bd
commit d959e53445
No known key found for this signature in database
GPG Key ID: 56054B6FF40DE0F9
5 changed files with 290 additions and 32 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@ count.out
/parts
/prime
/stage
vendor/
.idea/

View File

@ -3,9 +3,8 @@ sudo: required
dist: trusty
go_import_path: gobot.io/x/gobot
go:
- 1.7.6
- 1.8.5
- 1.9.2
- 1.8.4
- 1.9.1
- tip
matrix:
allow_failures:
@ -43,18 +42,21 @@ before_install:
- sudo ln /dev/null /dev/raw1394
- cd $HOME/gopath/src/gobot.io/x/gobot
- go get github.com/axw/gocov/gocov
- go get -u github.com/golang/dep/cmd/dep
before_cache:
- rm -f $HOME/fresh-cache
- rm -f $HOME/fresh-cache
install:
- make deps
- dep ensure
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
script:
- export CGO_CPPFLAGS="-I${HOME}/usr/include"
- export CGO_LDFLAGS="-L${HOME}/usr/lib -lopencv_core -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_calib3d -lopencv_video"
- echo "Ensuring code is well formatted"; ! gofmt -s -d . | read
- bash -c 'set -e; echo "" > coverage.txt; for d in $(go list ./...); do go test -covermode=set -coverprofile=p.out $d; if [ -f p.out ]; then cat p.out >> coverage.txt; rm p.out; fi; done'
- export CGO_LDFLAGS="-L${HOME}/usr/lib -lopencv_core -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_calib3d"
- echo "Running tests"
- make test_with_coverage
- echo "Checking that code is well-formatted"
- make fmt
after_success:
- bash <(curl -s https://codecov.io/bash)
branches:

171
Gopkg.lock generated Normal file
View File

@ -0,0 +1,171 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/bmizerany/pat"
packages = ["."]
revision = "6226ea591a40176dd3ff9cd8eff81ed6ca721a00"
[[projects]]
name = "github.com/codegangsta/cli"
packages = ["."]
revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1"
version = "v1.20.0"
[[projects]]
branch = "master"
name = "github.com/creack/goselect"
packages = ["."]
revision = "1bd5ca702c6154bccc56ecd598932ee8b295cab2"
[[projects]]
branch = "master"
name = "github.com/donovanhide/eventsource"
packages = ["."]
revision = "3ed64d21fb0b6bd8b49bcfec08f3004daee8723d"
[[projects]]
name = "github.com/eclipse/paho.mqtt.golang"
packages = [".","packets"]
revision = "aff15770515e3c57fc6109da73d42b0d46f7f483"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/go-ble/ble"
packages = [".","darwin","linux","linux/adv","linux/att","linux/gatt","linux/hci","linux/hci/cmd","linux/hci/evt","linux/hci/socket"]
revision = "788214691384e85e345bff9fd5eeb046f5983594"
[[projects]]
branch = "master"
name = "github.com/hashicorp/errwrap"
packages = ["."]
revision = "7554cd9344cec97297fa6649b055a8c98c2a1e55"
[[projects]]
branch = "master"
name = "github.com/hashicorp/go-multierror"
packages = ["."]
revision = "83588e72410abfbe4df460eeb6f30841ae47d4c4"
[[projects]]
branch = "master"
name = "github.com/hybridgroup/go-ardrone"
packages = ["client","client/commands","client/navdata"]
revision = "b9750d8d7b78f9638e5fdd899835e99d46b5a56c"
[[projects]]
name = "github.com/mattn/go-colorable"
packages = ["."]
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
version = "v0.0.9"
[[projects]]
name = "github.com/mattn/go-isatty"
packages = ["."]
revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39"
version = "v0.0.3"
[[projects]]
branch = "master"
name = "github.com/mgutz/ansi"
packages = ["."]
revision = "9520e82c474b0a04dd04f8a40959027271bab992"
[[projects]]
name = "github.com/mgutz/logxi"
packages = ["v1"]
revision = "aebf8a7d67ab4625e0fd4a665766fef9a709161b"
version = "v1"
[[projects]]
name = "github.com/nats-io/go-nats"
packages = ["encoders/builtin","util"]
revision = "29f9728a183bf3fa7e809e14edac00b33be72088"
version = "v1.3.0"
[[projects]]
name = "github.com/nats-io/nats"
packages = ["."]
revision = "29f9728a183bf3fa7e809e14edac00b33be72088"
version = "v1.3.0"
[[projects]]
name = "github.com/nats-io/nuid"
packages = ["."]
revision = "289cccf02c178dc782430d534e3c1f5b72af807f"
version = "v1.0.0"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
branch = "master"
name = "github.com/raff/goble"
packages = ["xpc"]
revision = "b12b34f940c4cf4363660073539b5fa9fd96bd16"
[[projects]]
branch = "master"
name = "github.com/sigurn/crc8"
packages = ["."]
revision = "e55481d6f45c5a8f040343bace9013571dae103e"
[[projects]]
branch = "master"
name = "github.com/sigurn/utils"
packages = ["."]
revision = "f19e41f79f8f006116f682c1af454591bc278ad4"
[[projects]]
branch = "master"
name = "github.com/tarm/serial"
packages = ["."]
revision = "794054cb266296569307c08d1b475f44505dfab1"
[[projects]]
name = "github.com/veandco/go-sdl2"
packages = ["sdl"]
revision = "30f30965227962032c13bd0b12a89e6a5107c768"
version = "v0.2"
[[projects]]
branch = "master"
name = "go.bug.st/serial.v1"
packages = [".","unixutils"]
revision = "eae1344f9f90101f887b08d13391c34399f97873"
[[projects]]
name = "gocv.io/x/gocv"
packages = ["."]
revision = "db20428799339d78526356473b0f5f00dccf075b"
version = "v0.3.1"
[[projects]]
branch = "master"
name = "golang.org/x/exp"
packages = ["io/spi","io/spi/driver"]
revision = "be09b602c40b1028d91bf805b38a6f54741fc34d"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["proxy","websocket"]
revision = "01c190206fbdffa42f334f4b2bf2220f50e64920"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix","windows"]
revision = "8eb05f94d449fdf134ec24630ce69ada5b469c1c"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "0a749d34ff067c74d2473ddacb9a8e0036294d5fcb64e656bd5c552b983b3c72"
solver-name = "gps-cdcl"
solver-version = 1

86
Gopkg.toml Normal file
View File

@ -0,0 +1,86 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
[[constraint]]
branch = "master"
name = "github.com/bmizerany/pat"
[[constraint]]
name = "github.com/codegangsta/cli"
version = "1.20.0"
[[constraint]]
branch = "master"
name = "github.com/donovanhide/eventsource"
[[constraint]]
name = "github.com/eclipse/paho.mqtt.golang"
version = "1.1.0"
[[constraint]]
branch = "master"
name = "github.com/go-ble/ble"
[[constraint]]
branch = "master"
name = "github.com/hashicorp/go-multierror"
[[constraint]]
branch = "master"
name = "github.com/hybridgroup/go-ardrone"
[[constraint]]
name = "github.com/nats-io/nats"
version = "1.3.0"
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
branch = "master"
name = "github.com/sigurn/crc8"
[[constraint]]
branch = "master"
name = "github.com/tarm/serial"
[[constraint]]
name = "github.com/veandco/go-sdl2"
version = "0.2.0"
[[constraint]]
branch = "master"
name = "go.bug.st/serial.v1"
[[constraint]]
name = "gocv.io/x/gocv"
version = "0.3.1"
[[constraint]]
branch = "master"
name = "golang.org/x/exp"
[[constraint]]
branch = "master"
name = "golang.org/x/net"

View File

@ -1,14 +1,23 @@
.PHONY: test race cover robeaux examples deps
.PHONY: test race cover robeaux examples deps test_with_coverage fmt_check
excluding_vendor := $(shell go list ./... | grep -v /vendor/)
# Run tests on all non-vendor directories
test:
go test ./...
go test -v $(excluding_vendor)
# Run tests with race detection on all non-vendor directories
race:
go test ./... -race
go test -race $(excluding_vendor)
cover:
# Check for code well-formedness
fmt_check:
gofmt -s -d . | read
# Test and generate coverage
test_with_coverage:
echo "" > profile.cov
for package in $$(go list ./...) ; do \
for package in $(excluding_vendor) ; do \
go test -covermode=count -coverprofile=tmp.cov $$package ; \
if [ -f tmp.cov ]; then \
cat tmp.cov >> profile.cov ; \
@ -16,6 +25,13 @@ cover:
fi ; \
done
deps:
ifeq (,$(shell which dep))
$(error dep tool not found! https://github.com/golang/dep is required to install Gobot deps)
endif
dep ensure
robeaux:
ifeq (,$(shell which go-bindata))
$(error robeaux not built! https://github.com/jteeuwen/go-bindata is required to build robeaux assets )
@ -40,22 +56,3 @@ examples:
for example in $(EXAMPLES) ; do \
go build -o /tmp/$$example examples/$$example ; \
done ; \
deps:
go get -d -v \
github.com/bmizerany/pat \
github.com/codegangsta/cli \
github.com/go-ble/ble \
github.com/donovanhide/eventsource \
github.com/eclipse/paho.mqtt.golang \
github.com/hashicorp/go-multierror \
github.com/hybridgroup/go-ardrone/client \
gocv.io/x/gocv \
github.com/mgutz/logxi/v1 \
github.com/nats-io/nats \
github.com/sigurn/crc8 \
go.bug.st/serial.v1 \
github.com/veandco/go-sdl2/sdl \
golang.org/x/net/websocket \
golang.org/x/exp/io/spi \
golang.org/x/sys/unix