-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
38 lines (31 loc) · 1023 Bytes
/
.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
language: go
go:
- 1.11.x
- 1.12.x
- 1.13.x
env:
- GO111MODULE=on
services:
- mongodb
before_install:
- go get -t -v
# Add user and replica set to mongo by help of https://georgeshank.com/how-to-enable-a-mongodb-replica-set-on-travis/
before_script:
- sleep 15 # To Fix issue of https://docs.travis-ci.com/user/database-setup/#mongodb-does-not-immediately-accept-connections
- |
mongo admin --eval 'db.createUser(
{
user: "root",
pwd: "12345",
roles: [ { role: "root", db: "admin" } ]
}
)'
- 'echo "replication:" | sudo tee -a /etc/mongod.conf'
- 'echo " replSetName: rs0" | sudo tee -a /etc/mongod.conf'
- sudo systemctl restart mongod
- sleep 20 # To Fix issue of https://docs.travis-ci.com/user/database-setup/#mongodb-does-not-immediately-accept-connections
- mongo -u root -p 12345 --eval 'rs.initiate()'
script:
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
after_success:
- bash <(curl -s https://codecov.io/bash)