forked from nats-io/nats-streaming-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (41 loc) · 1.26 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
language: go
sudo: false
go:
- 1.11.x
- 1.12.x
addons:
apt:
packages:
- rpm
env:
- GO111MODULE=off
go_import_path: github.com/nats-io/nats-streaming-server
install:
- go get -t ./...
- go get github.com/nats-io/nats-server
- go get -u honnef.co/go/tools/cmd/staticcheck
- go get -u github.com/client9/misspell/cmd/misspell
- go get -u github.com/go-sql-driver/mysql
services:
- mysql
before_script:
- EXCLUDE_VENDOR=$(go list ./... | grep -v "/vendor/")
- EXCLUDE_VENDOR_AND_PROTO_DIR=$(go list ./... | grep -v "/vendor/" | grep -v "/spb")
- go install
- $(exit $(go fmt $EXCLUDE_VENDOR | wc -l))
- go vet $EXCLUDE_VENDOR
- $(exit $(misspell -locale US $EXCLUDE_VENDOR_AND_PROTO_DIR | wc -l))
- $(exit $(misspell -locale US README.md | wc -l))
- staticcheck $EXCLUDE_VENDOR_AND_PROTO_DIR
script:
- mysql -u root -e "CREATE USER 'nss'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'nss'@'localhost'; CREATE DATABASE test_nats_streaming;"
- go test -i $EXCLUDE_VENDOR
- if [[ "$TRAVIS_GO_VERSION" =~ 1.12 ]]; then ./scripts/cov.sh TRAVIS; else go test -failfast $EXCLUDE_VENDOR; fi
deploy:
provider: script
skip_cleanup: true
script: curl -sL http://git.io/goreleaser | bash
verbose: true
on:
tags: true
condition: $TRAVIS_GO_VERSION =~ 1.11