2018-04-25 15:55:26 +01:00
|
|
|
language: go
|
|
|
|
|
2018-10-24 12:51:49 +01:00
|
|
|
go: 1.11.x
|
|
|
|
go_import_path: "storj.io/storj"
|
2018-04-25 15:55:26 +01:00
|
|
|
|
2018-09-11 14:13:25 +01:00
|
|
|
git:
|
|
|
|
depth: 1
|
|
|
|
|
2018-10-16 18:02:00 +01:00
|
|
|
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';
|
2018-11-15 18:36:57 +00:00
|
|
|
psql -c 'create database teststorj' -U postgres;
|
2018-10-25 18:11:28 +01:00
|
|
|
fi;
|
2018-09-25 19:23:21 +01:00
|
|
|
|
2018-04-25 15:55:26 +01:00
|
|
|
before_install:
|
2018-10-16 18:02:00 +01:00
|
|
|
- source scripts/setup-gopath.sh
|
2018-10-19 19:55:06 +01:00
|
|
|
matrix:
|
2018-10-24 12:51:49 +01:00
|
|
|
allow_failures:
|
|
|
|
- os: windows # allow failures on windows because it's slow
|
2018-10-19 19:55:06 +01:00
|
|
|
include:
|
2018-10-24 12:51:49 +01:00
|
|
|
### tests ###
|
2018-10-25 18:11:28 +01:00
|
|
|
- env:
|
|
|
|
- MODE=tests
|
2018-11-15 18:36:57 +00:00
|
|
|
- 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:
|
2018-11-19 15:40:44 +00:00
|
|
|
- go run scripts/use-ports.go -from 1024 -to 10000 &
|
2018-10-29 14:21:23 +00:00
|
|
|
- go test -race -cover -coverprofile=.coverprofile -json ./... | tparse -all
|
2018-10-19 19:55:06 +01:00
|
|
|
- goveralls -coverprofile=.coverprofile -service=travis-ci
|
2018-11-16 18:26:13 +00:00
|
|
|
- rm .coverprofile
|
|
|
|
- go run scripts/check-clean-directory.go
|
2018-10-24 12:51:49 +01:00
|
|
|
|
|
|
|
### 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-10-19 19:55:06 +01:00
|
|
|
script:
|
2018-11-15 12:47:52 +00:00
|
|
|
- go run ./scripts/check-copyright.go
|
2018-10-19 19:55:06 +01:00
|
|
|
- golangci-lint run
|
2018-11-09 13:32:35 +00:00
|
|
|
- gospace istidy
|
2018-10-24 12:51:49 +01:00
|
|
|
|
|
|
|
### 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
|
2018-10-24 12:51:49 +01:00
|
|
|
|
|
|
|
### windows tests ###
|
|
|
|
- env: MODE=windows-tests
|
|
|
|
os: windows
|
2018-10-29 14:21:23 +00:00
|
|
|
services:
|
|
|
|
- redis
|
2018-10-24 12:51:49 +01:00
|
|
|
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
|
2018-10-25 18:11:28 +01:00
|
|
|
|
|
|
|
addons:
|
|
|
|
postgresql: "9.5"
|