router7/.travis.yml

29 lines
1.2 KiB
YAML
Raw Normal View History

2018-07-14 15:17:48 +02:00
# Use the (faster) container-based infrastructure, see also
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: required
dist: xenial
2018-07-14 15:17:48 +02:00
services:
- docker
language: go
go:
2020-02-15 09:55:44 +01:00
- "1.13"
2018-07-14 15:17:48 +02:00
install:
- go get -t -v -d ./...
script:
# Check whether files are syntactically correct.
- "gofmt -l $(find . -name '*.go' | tr '\\n' ' ') >/dev/null"
# Check whether files were not gofmt'ed.
- "gosrc=$(find . -name '*.go' | tr '\\n' ' '); [ $(gofmt -l $gosrc 2>&- | wc -l) -eq 0 ] || (echo 'gofmt was not run on these files:'; gofmt -l $gosrc 2>&-; false)"
# TODO: remove the || true suffix once vet errors are fixed
2019-04-29 18:42:29 +02:00
- go vet . || true
- sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
2018-07-14 15:17:48 +02:00
- go build ./cmd/...
- go test -v -race ./internal/...
- docker build --pull --no-cache --rm -t=router7 -f travis/Dockerfile .
- sudo service docker restart
# NOTE: this must be the last command because of the travis_terminate usage:
- exit=0; for pkg in $(go list ./integration/...); do go test -c $pkg && docker run --privileged --net=host -v $PWD:/usr/src:ro router7 /bin/sh -c "./$(basename $pkg).test -test.v" || exit=1; done; [ $exit = 0 ] || travis_terminate 1