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"
|
2019-11-20 18:45:09 +08:00
|
|
|
- "1.13.x"
|
2020-02-26 11:54:46 +08:00
|
|
|
- "1.14.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:
|
2020-02-26 11:57:26 +08:00
|
|
|
- GF_DEBUG=1 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-11-20 12:34:03 +08:00
|
|
|
- echo "UPDATE mysql.user SET authentication_string=PASSWORD('12345678') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
|
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
|
|
|
|
|
|
|
|
|
|
|
|