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
|
2019-01-03 19:54:27 +00:00
|
|
|
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
2018-09-25 19:23:21 +01:00
|
|
|
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-12-07 13:07:53 +00:00
|
|
|
- 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
|
2018-11-16 18:26:13 +00:00
|
|
|
- rm .coverprofile
|
|
|
|
- go run scripts/check-clean-directory.go
|
2019-01-03 19:54:27 +00:00
|
|
|
|
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-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:
|
2018-11-15 12:47:52 +00:00
|
|
|
- go run ./scripts/check-copyright.go
|
2019-01-08 14:05:14 +00:00
|
|
|
- go run ./scripts/check-imports.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
|
2019-01-03 19:54:27 +00:00
|
|
|
|
2019-01-05 21:24:31 +00:00
|
|
|
### service integration tests ###
|
2019-01-08 15:24:15 +00: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
|
2019-01-11 16:18:16 +00:00
|
|
|
- go install -race storj.io/storj/cmd/{storj-sdk,bootstrap,satellite,storagenode,uplink,gateway,certificates,captplanet}
|
2018-10-19 19:55:06 +01:00
|
|
|
script:
|
2019-01-11 16:18:16 +00:00
|
|
|
- set -o pipefail && make test-storj-sdk |& go run scripts/fail-on-race.go
|
|
|
|
- set -o pipefail && make test-certificate-signing |& go run scripts/fail-on-race.go
|
|
|
|
- set -o pipefail && make test-captplanet |& go run scripts/fail-on-race.go
|
2019-01-04 17:23:23 +00:00
|
|
|
|
2019-01-08 15:24:15 +00:00
|
|
|
### Docker tests ###
|
2019-01-04 16:38:57 +00:00
|
|
|
- env: MODE=docker
|
2019-01-03 19:54:27 +00:00
|
|
|
services:
|
|
|
|
- docker
|
2019-01-04 16:38:57 +00:00
|
|
|
before_install:
|
|
|
|
- echo "skip"
|
2019-01-03 19:54:27 +00:00
|
|
|
install:
|
|
|
|
- source scripts/install-awscli.sh
|
|
|
|
script:
|
2019-01-11 16:18:16 +00:00
|
|
|
- set -o pipefail && make test-all-in-one |& go run scripts/fail-on-race.go
|
2019-01-03 19:54:27 +00:00
|
|
|
|
2018-10-24 12:51:49 +01:00
|
|
|
### windows tests ###
|
|
|
|
- env: MODE=windows-tests
|
2018-12-10 19:55:04 +00:00
|
|
|
if: commit_message =~ /(?i:windows)/
|
2018-10-24 12:51:49 +01:00
|
|
|
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"
|