2018-12-17 13:02:18 +08:00
|
|
|
language: go
|
|
|
|
|
|
|
|
go:
|
2019-03-03 00:14:20 +08:00
|
|
|
- "1.11.x"
|
|
|
|
- "1.12.x"
|
2018-12-17 13:02:18 +08:00
|
|
|
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2018-12-17 13:02:55 +08:00
|
|
|
- develop
|
2019-08-01 11:42:51 +08:00
|
|
|
- staging
|
2018-12-17 13:02:18 +08:00
|
|
|
|
2018-12-17 13:46:06 +08:00
|
|
|
env:
|
2019-10-29 19:59:24 +08:00
|
|
|
- GF_DEV=1
|
2019-04-15 15:41:51 +08:00
|
|
|
- GO111MODULE=on
|
2018-12-17 13:57:15 +08:00
|
|
|
|
|
|
|
services:
|
2019-04-15 15:41:51 +08:00
|
|
|
- mysql
|
|
|
|
- redis-server
|
2019-08-12 16:57:08 +08:00
|
|
|
- postgresql
|
2018-12-17 13:24:53 +08:00
|
|
|
|
2019-03-08 08:48:53 +08:00
|
|
|
addons:
|
2019-08-12 16:57:08 +08:00
|
|
|
postgresql: "9.4"
|
2019-03-08 08:48:53 +08:00
|
|
|
hosts:
|
2019-04-15 15:41:51 +08:00
|
|
|
- local
|
2019-03-08 08:48:53 +08:00
|
|
|
|
2018-12-17 13:24:53 +08:00
|
|
|
before_install:
|
2019-07-18 18:59:49 +08:00
|
|
|
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
|
2018-12-17 13:50:17 +08:00
|
|
|
|
|
|
|
install:
|
2019-04-15 15:41:51 +08:00
|
|
|
- cat /etc/hosts
|
2018-12-17 13:24:53 +08:00
|
|
|
|
2019-06-25 19:10:37 +08:00
|
|
|
before_script:
|
|
|
|
- find . -name "*.go" | xargs gofmt -w
|
2019-08-10 19:55:01 +08:00
|
|
|
- git diff --name-only --exit-code || exit 1
|
2019-08-12 16:57:08 +08:00
|
|
|
- psql -c 'create database travis_ci_test;' -U postgres
|
2019-06-25 19:10:37 +08:00
|
|
|
|
2018-12-17 13:02:18 +08:00
|
|
|
script:
|
2019-09-23 23:24:36 +08:00
|
|
|
- GOARCH=386 go test -v ./... || exit 1
|
2019-04-15 15:41:51 +08:00
|
|
|
- GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
|
2019-01-17 16:06:56 +08:00
|
|
|
|
2018-12-17 13:24:53 +08:00
|
|
|
after_success:
|
2019-04-15 15:41:51 +08:00
|
|
|
- bash <(curl -s https://codecov.io/bash)
|
2018-12-17 13:02:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|