2019-10-04 15:21:24 +00:00
|
|
|
language: go
|
|
|
|
|
|
|
|
os:
|
|
|
|
- linux
|
|
|
|
- osx
|
|
|
|
|
|
|
|
go:
|
2019-11-04 10:08:22 +00:00
|
|
|
- 1.8.x
|
|
|
|
- 1.10.x
|
2019-10-04 15:21:24 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- PROJ="github.com/elastic/gosigar"
|
|
|
|
|
|
|
|
sudo: false
|
|
|
|
|
|
|
|
before_install:
|
|
|
|
# Put project into proper GOPATH location (important for forks).
|
|
|
|
- mkdir -p $HOME/gopath/src/${PROJ}
|
|
|
|
- rsync -az ${TRAVIS_BUILD_DIR}/ $HOME/gopath/src/${PROJ}/
|
|
|
|
- export TRAVIS_BUILD_DIR=$HOME/gopath/src/${PROJ}
|
|
|
|
- cd $HOME/gopath/src/${PROJ}
|
|
|
|
|
|
|
|
install:
|
|
|
|
- go get -v -t -d ./...
|
|
|
|
- go get github.com/elastic/beats/vendor/github.com/pierrre/gotestcover
|
|
|
|
|
|
|
|
script:
|
|
|
|
- gofmt -l . | read && echo "Code differs from gofmt's style. Run 'gofmt -w .'" 1>&2 && exit 1 || true
|
|
|
|
- go vet
|
|
|
|
- go build
|
|
|
|
- mkdir -p build/coverage
|
|
|
|
- gotestcover -v -coverprofile=build/coverage/unit.cov github.com/elastic/gosigar/...
|
|
|
|
- for i in $(ls examples); do go build -o examples/$i/$i ./examples/$i; ./examples/$i/$i; done
|
|
|
|
|
|
|
|
after_success:
|
|
|
|
- bash <(curl -s https://codecov.io/bash) -f build/coverage/unit.cov
|