storj/.travis.yml

112 lines
3.4 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
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';
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
2019-01-16 19:02:42 +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
2019-01-16 19:02:42 +00:00
# - gospace istidy
### 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-16 23:09:57 +00:00
- make install-sim
2018-10-19 19:55:06 +01:00
script:
2019-01-16 23:09:57 +00:00
- set -o pipefail && make test-sim |& go run scripts/fail-on-race.go
- set -o pipefail && make test-certificate-signing |& go run scripts/fail-on-race.go
2019-01-08 15:24:15 +00:00
### Docker tests ###
- env: MODE=docker
2019-01-16 19:02:42 +00:00
if: commit_message =~ /(?i:docker)/
services:
- docker
before_install:
- echo "skip"
install:
- source scripts/install-awscli.sh
script:
- set -o pipefail && make test-all-in-one |& go run scripts/fail-on-race.go
### windows tests ###
- env: MODE=windows-tests
if: commit_message =~ /(?i:windows)/
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"