forked from gomods/athens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
37 lines (37 loc) · 1.25 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
services:
- mongodb
- postgresql
- redis-server
language: go
install: false
go:
- "1.10.x"
env:
global:
- PATH=${PATH}:./bin
- POP_PATH=$PWD/cmd/proxy
- GO_ENV=test_postgres
- MINIO_ACCESS_KEY=minio
- MINIO_SECRET_KEY=minio123
- ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017
- CODE_COV=1
script:
- test -z $(gofmt -s -l $GO_FILES | tee /dev/stderr) # Fail if a .go file hasn't been formatted with gofmt
- golint -set_exit_status $(go list ./... | grep -v '/mocks') # Linter
- go test -race -coverprofile cover.out -covermode atomic ./... # Run all the tests with the race detector and code coverage enabled
before_script:
- mkdir bin
- GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
- go get github.com/golang/lint/golint
- wget "https://dl.minio.io/server/minio/release/linux-amd64/minio"
- chmod +x minio && nohup ./minio server . &
- ./scripts/get_buffalo.sh
- go get -u -v golang.org/x/vgo
- buffalo db create
- buffalo db migrate up
after_success:
- if [ "${CODE_COV}" == "1" ]; then
curl -s https://codecov.io/bash -o codecov && bash codecov -X fix;
else
echo codecov not enabled;
fi