storj/.travis.yml

97 lines
2.9 KiB
YAML
Raw Normal View History

2018-04-25 15:55:26 +01:00
language: go
go: 1.11.x
go_import_path: "storj.io/storj"
2018-04-25 15:55:26 +01:00
git:
depth: 1
cache:
directories:
- /home/travis/cache
2018-09-25 19:23:21 +01:00
before_script:
# Add an IPv6 config - see the corresponding Travis issue
# https://github.com/travis-ci/travis-ci/issues/8361
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
sudo sh -c 'echo "\n::1 localhost\n" >> /etc/hosts';
psql -c 'create database teststorj' -U postgres;
fi;
2018-09-25 19:23:21 +01:00
2018-04-25 15:55:26 +01:00
before_install:
- source scripts/setup-gopath.sh
2018-10-19 19:55:06 +01:00
matrix:
allow_failures:
- os: windows # allow failures on windows because it's slow
2018-10-19 19:55:06 +01:00
include:
### tests ###
- env:
- MODE=tests
- STORJ_POSTGRES_TEST=postgres://postgres@localhost/teststorj?sslmode=disable
2018-10-29 14:21:23 +00:00
services:
- redis
- postgresql
2018-10-19 19:55:06 +01:00
install:
- pushd ~
- GOBIN=${GOPATH}/bin GOPATH=~/gotools go get github.com/mattn/goveralls
2018-10-29 14:21:23 +00:00
- GOBIN=${GOPATH}/bin GOPATH=~/gotools go get github.com/mfridman/tparse
2018-10-19 19:55:06 +01:00
- popd
- go install -race ./...
script:
- go run scripts/use-ports.go -from 1024 -to 10000 &
- go test -race -cover -coverprofile=.coverprofile -json -timeout 9m ./... | tparse -all
2018-10-19 19:55:06 +01:00
- goveralls -coverprofile=.coverprofile -service=travis-ci
- rm .coverprofile
- go run scripts/check-clean-directory.go
### run linters ###
2018-10-19 19:55:06 +01:00
- env: MODE=lint
install:
2018-11-12 15:00:06 +00:00
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.12.2
2018-11-30 15:02:01 +00:00
# install protoc
- curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o /tmp/protoc.zip
- unzip /tmp/protoc.zip -d "$HOME"/protoc
# install proto linter
- cp go.mod go.mod.backup
- go get github.com/ckaznocha/protoc-gen-lint
- go get golang.org/x/tools/go/packages
- cp go.mod.backup go.mod
2018-10-19 19:55:06 +01:00
script:
- go run ./scripts/check-copyright.go
2018-11-30 15:02:01 +00:00
- go run ./scripts/protobuf.go --protoc=$HOME/protoc/bin/protoc lint
2018-10-19 19:55:06 +01:00
- golangci-lint run
2018-11-09 13:32:35 +00:00
- gospace istidy
### captplanet tests ###
2018-10-19 19:55:06 +01:00
- env: MODE=integration
2018-10-29 14:21:23 +00:00
services:
- redis
2018-10-19 19:55:06 +01:00
install:
- source scripts/install-awscli.sh
- go install storj.io/storj/cmd/captplanet
script:
- make test-captplanet
### windows tests ###
- env: MODE=windows-tests
os: windows
2018-10-29 14:21:23 +00:00
services:
- redis
cache:
directories:
- "%HOME%/cache"
before_install:
- powershell -executionpolicy bypass -File scripts/setup-gopath.ps1
install:
- go get github.com/mattn/goveralls
- go install -race ./...
script:
- go test -race -cover -coverprofile=.coverprofile ./...
- goveralls -coverprofile=.coverprofile -service=travis-ci
2018-10-19 19:55:06 +01:00
fast_finish: true
addons:
postgresql: "9.5"