-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.travis.yml
62 lines (53 loc) · 1.59 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
language: go
sudo: false
go:
- tip
services:
- docker
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-client
env:
global:
- GO111MODULE=on
- DOCKER_COMPOSE_VERSION=1.27.4
- GO_GIN_CONF=${GOPATH}/src/github.com/hiromaily/go-gin-wrapper/configs/travis.toml
cache:
directories:
#/home/travis/gopath
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
before_install:
# install docker compose
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
# go dependencies
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- go get github.com/golangci/golangci-lint/cmd/golangci-lint
install:
# install go packages
- go mod download
# setup docker containers
- docker-compose -f docker-compose.ci.yml build mysql
- docker-compose -f docker-compose.ci.yml up -d mysql
- sleep 3s
- docker ps -a
## comment out until test fixed and refactoring done
before_script:
- ./scripts/wait-mysql.sh 127.0.0.1 13306 echo "go test! go test! go test!"
- make setup-testdb
script:
#- golangci-lint run
#- go test -v -race -covermode=atomic -coverprofile=profile.cov ./cmd/ginserver/... -f ../../configs/travis.toml -crypto -om 0
- go clean -testcache
- go test -race -tags=integration -v -covermode=atomic -coverprofile=profile.cov ./...
- goveralls -coverprofile=profile.cov -service=travis-ci
branches:
only:
- master