2018-05-05 15:00:19 +02:00
|
|
|
# Use the (faster) container-based infrastructure, see also
|
|
|
|
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
|
|
|
sudo: false
|
|
|
|
dist: trusty
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
language: go
|
|
|
|
go:
|
2019-10-22 08:47:49 +02:00
|
|
|
- "1.13"
|
2018-05-05 15:00:19 +02:00
|
|
|
go_import_path: github.com/stapelberg/dnsmasq_exporter
|
|
|
|
|
|
|
|
|
|
|
|
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)"
|
2019-10-22 08:55:57 +02:00
|
|
|
- go vet .
|
2018-05-05 15:00:19 +02:00
|
|
|
- go test -c
|
|
|
|
- docker build --pull --no-cache --rm -t=dns -f travis/Dockerfile .
|
|
|
|
- docker run -v $PWD:/usr/src:ro dns /bin/sh -c './dnsmasq_exporter.test -test.v'
|