forked from ipfs-search/ipfs-search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (48 loc) · 1.6 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
env:
global:
- CC_TEST_REPORTER_ID=8682688bc269d0f558949836dc3a7da18cd504940d6a4034c4539203dbe3fa22
language: go
go:
- 1.9.x
services:
- rabbitmq
- elasticsearch
# Setup caching of dependencies
# before_cache:
# - rm -rf $GOPATH/src/github.com/ipfs-search/*
# - rm -rf $GOPATH/pkg/**/github.com/ipfs-search/ipfs-search
# cache:
# directories:
# - $GOPATH/src
# - $GOPATH/pkg
install: go get -t -v ./...
before_script:
# Install CodeClimate test reporter
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script: |
# Thank https://stackoverflow.com/questions/45776043/codeclimate-test-coverage-formatter-for-golang
RC=0
for pkg in $(go list ./... | grep -v vendor); do
go test -coverprofile=$(echo $pkg | tr / -).cover $pkg || RC=$?
done
echo "mode: set" > c.out
grep -h -v "^mode:" ./*.cover >> c.out
rm -f *.cover
# Smoke test; should keep running 10 seconds; 124 is timeout is success
make
timeout 10 build/ipfs-search c; [ $? -ne 124 ] && RC=$?
exit $RC
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
# Matrix/Riot webhook notifications
notifications:
email: false
webhooks:
# This is a bit overly verbose right now (link previews...)
# urls:
# - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGRva3RlcmJvYiUzQWNoYXQud2Voby5zdC8lMjFNR1pUZWlZUm9XZllmSmxMckUlM0FjaGF0LndlaG8uc3Q"
on_success: change # always|never|change
on_failure: always
on_start: never