Before this commit, if for example the linter failed, then we would go on to all the other tests rather than halting. We fix this by instead chaining the relevant commands, and eliminating the LINT env variable in the build matrix.
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
language: go
|
|
cache:
|
|
directories:
|
|
- vendor/
|
|
- $GOCACHE
|
|
- $GOPATH/pkg/mod
|
|
- $GOPATH/src/github.com/btcsuite
|
|
- $GOPATH/src/github.com/golang
|
|
- $GOPATH/src/gopkg.in/alecthomas
|
|
|
|
go:
|
|
- "1.11.x"
|
|
|
|
env:
|
|
global:
|
|
- GOCACHE=$HOME/.go-build
|
|
matrix:
|
|
- RACE=true
|
|
- ITEST=true
|
|
- COVER=true
|
|
|
|
sudo: required
|
|
install:
|
|
- sudo add-apt-repository -y ppa:bitcoin/bitcoin -y
|
|
- sudo apt-get update -q
|
|
- sudo apt-get install bitcoind -y
|
|
- export PATH=$PATH:$PWD/linux-amd64/
|
|
|
|
script:
|
|
- env GO111MODULE=on
|
|
|
|
# Common for all builds.
|
|
- make btcd
|
|
|
|
# Run unit tests with race condition detector.
|
|
- 'if [ "$RACE" = true ]; then make unit-race ; fi'
|
|
|
|
# Run integration tests.
|
|
- 'if [ "$ITEST" = true ]; then make build && make itest-only; fi'
|
|
|
|
# Run unit tests and generate coverage report.
|
|
- 'if [ "$COVER" = true ]; then make lint && make unit-cover && make goveralls; fi'
|
|
|
|
after_script:
|
|
- echo "Uploading to termbin.com..." && find *.log | xargs -I{} sh -c "cat {} | nc termbin.com 9999 | xargs -r0 printf '{} uploaded to %s'"
|
|
- echo "Uploading to file.io..." && tar -zcvO *.log | curl -s -F 'file=@-;filename=logs.tar.gz' https://file.io | xargs -r0 printf 'logs.tar.gz uploaded to %s\n'
|