2016-06-09 00:12:13 +02:00
|
|
|
language: go
|
2018-10-11 10:31:05 +02:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $GOCACHE
|
2018-11-29 02:18:21 +01:00
|
|
|
- $GOPATH/pkg/mod
|
2018-10-11 10:31:05 +02:00
|
|
|
- $GOPATH/src/github.com/btcsuite
|
|
|
|
- $GOPATH/src/github.com/golang
|
2019-05-23 00:24:40 +02:00
|
|
|
- $GOPATH/src/github.com/grpc-ecosystem
|
2018-10-11 10:31:05 +02:00
|
|
|
- $GOPATH/src/gopkg.in/alecthomas
|
2019-05-23 00:24:40 +02:00
|
|
|
- $GOPATH/src/google.golang.org
|
2018-10-11 10:31:05 +02:00
|
|
|
|
2020-02-20 20:18:43 +01:00
|
|
|
# Remove Travis' default flag --depth=50 from the git clone command to make sure
|
|
|
|
# we have the whole git history, including the commit we lint against.
|
|
|
|
git:
|
|
|
|
depth: false
|
|
|
|
|
2018-11-16 11:08:16 +01:00
|
|
|
go:
|
2020-12-12 11:26:00 +01:00
|
|
|
# If you change this value, please change it in the following files as well:
|
|
|
|
# /Dockerfile
|
|
|
|
# /dev.Dockerfile
|
2021-01-08 10:40:17 +01:00
|
|
|
# /make/builder.Dockerfile
|
2020-12-12 11:26:00 +01:00
|
|
|
# /.github/workflows/main.yml
|
|
|
|
# /.github/workflows/release.yml
|
2021-02-17 01:18:35 +01:00
|
|
|
- 1.16.3
|
2018-11-16 11:08:16 +01:00
|
|
|
|
|
|
|
env:
|
2018-10-11 10:31:05 +02:00
|
|
|
global:
|
|
|
|
- GOCACHE=$HOME/.go-build
|
2020-10-08 14:58:49 +02:00
|
|
|
- BITCOIN_VERSION=0.20.1
|
2018-10-11 10:31:05 +02:00
|
|
|
|
2018-01-17 17:07:31 +01:00
|
|
|
sudo: required
|
2018-10-11 10:31:05 +02:00
|
|
|
|
travis: staged travis builds
This PR introduces staging to our travis pipeline. Currently all
instances perform:
- compilation of lnd
- linting
- compilation and installation of btcd binaries
- installation of bitcoind binaries
In total this adds about 3 minutes to each of our 5 instances, resulting in
roughly 12 minutes of redundant execution time. Additionally, if if a build
fails to compile or lint we detect this 5 separate times, consuming precious
instances from other builds.
We alleviate this by adding an initial Build phase, which runs a single
instance performing the actions above. This has the benefit of quickly sanity
checking the pr before moving on to the more expensive unit or integration test
suites, and failing faster for common mistakes. It also warms up the build
caches for the Test stage in one fell swoop.
For instance, if 5 people push changes at the same time, they can all get
immediate feedback regarding compilation or linting issues, and potentially
save hours waiting for other people's test to finish or fail before finding out
they had a spelling error. This doesn't alleviate all possible issues, e.g. the
5 instances may already be consumed by test suites, but it does make a sizable
step towards minimizing time-to-failure in common scenarios.
2019-12-05 04:53:20 +01:00
|
|
|
jobs:
|
|
|
|
include:
|
2020-07-29 09:50:37 +02:00
|
|
|
- stage: Sanity Check
|
|
|
|
name: Lint and compile
|
|
|
|
script:
|
|
|
|
# Step 1: Make sure no diff is produced when compiling with the correct
|
|
|
|
# version.
|
|
|
|
- make rpc-check
|
|
|
|
|
|
|
|
# Step 2: Make sure the unit tests compile, but don't run them. They run
|
|
|
|
# in a GitHub Workflow.
|
|
|
|
- make unit pkg=... case=_NONE_
|
|
|
|
|
2020-09-04 14:10:03 +02:00
|
|
|
# Step 3: Lint go code. Invoke GC more often to reduce memory usage.
|
|
|
|
- GOGC=30 make lint
|
2020-07-29 09:50:37 +02:00
|
|
|
|
2020-07-23 15:06:05 +02:00
|
|
|
- stage: Integration Test
|
travis: staged travis builds
This PR introduces staging to our travis pipeline. Currently all
instances perform:
- compilation of lnd
- linting
- compilation and installation of btcd binaries
- installation of bitcoind binaries
In total this adds about 3 minutes to each of our 5 instances, resulting in
roughly 12 minutes of redundant execution time. Additionally, if if a build
fails to compile or lint we detect this 5 separate times, consuming precious
instances from other builds.
We alleviate this by adding an initial Build phase, which runs a single
instance performing the actions above. This has the benefit of quickly sanity
checking the pr before moving on to the more expensive unit or integration test
suites, and failing faster for common mistakes. It also warms up the build
caches for the Test stage in one fell swoop.
For instance, if 5 people push changes at the same time, they can all get
immediate feedback regarding compilation or linting issues, and potentially
save hours waiting for other people's test to finish or fail before finding out
they had a spelling error. This doesn't alleviate all possible issues, e.g. the
5 instances may already be consumed by test suites, but it does make a sizable
step towards minimizing time-to-failure in common scenarios.
2019-12-05 04:53:20 +01:00
|
|
|
name: Btcd Integration
|
2020-07-23 15:06:05 +02:00
|
|
|
script:
|
2020-11-04 11:03:33 +01:00
|
|
|
- make itest-parallel
|
2020-07-23 15:06:05 +02:00
|
|
|
|
2020-10-09 13:35:06 +02:00
|
|
|
- name: Bitcoind Integration (txindex enabled)
|
2020-07-23 15:06:05 +02:00
|
|
|
script:
|
|
|
|
- bash ./scripts/install_bitcoind.sh
|
2020-11-04 11:03:33 +01:00
|
|
|
- make itest-parallel backend=bitcoind
|
2020-07-23 15:06:05 +02:00
|
|
|
|
2021-01-06 19:42:29 +01:00
|
|
|
- name: Bitcoind Integration with etcd (txindex enabled)
|
|
|
|
script:
|
|
|
|
- bash ./scripts/install_bitcoind.sh
|
2021-06-14 12:31:08 +02:00
|
|
|
- make itest-parallel backend=bitcoind dbbackend=etcd
|
2021-01-06 19:42:29 +01:00
|
|
|
|
2020-10-09 13:35:06 +02:00
|
|
|
- name: Bitcoind Integration (txindex disabled)
|
|
|
|
script:
|
|
|
|
- bash ./scripts/install_bitcoind.sh
|
2020-11-04 11:03:33 +01:00
|
|
|
- make itest-parallel backend="bitcoind notxindex"
|
2020-10-09 13:35:06 +02:00
|
|
|
|
2020-07-23 15:06:05 +02:00
|
|
|
- name: Neutrino Integration
|
|
|
|
script:
|
2020-11-04 11:03:33 +01:00
|
|
|
- make itest-parallel backend=neutrino
|
2020-07-23 15:06:05 +02:00
|
|
|
|
2021-09-06 13:50:12 +02:00
|
|
|
- name: Bitcoind Integration ARM
|
2020-07-22 15:40:02 +02:00
|
|
|
script:
|
2021-09-06 13:50:12 +02:00
|
|
|
- bash ./scripts/install_bitcoind.sh
|
2021-09-15 10:24:35 +02:00
|
|
|
- GOARM=7 GOARCH=arm GOOS=linux make itest-parallel backend=bitcoind tranches=2 parallel=2
|
2020-07-22 15:40:02 +02:00
|
|
|
arch: arm64
|
2021-09-06 13:50:12 +02:00
|
|
|
services:
|
|
|
|
- docker
|
2018-10-11 10:31:05 +02:00
|
|
|
|
2020-07-31 10:32:31 +02:00
|
|
|
- name: Btcd Integration Windows
|
|
|
|
script:
|
2021-05-14 10:09:02 +02:00
|
|
|
# The windows VM seems to be slower than the other Travis VMs. We only
|
|
|
|
# run 2 test suites in parallel instead of the default 4.
|
2021-09-15 10:24:35 +02:00
|
|
|
- make itest-parallel windows=1 tranches=2 parallel=2
|
2020-07-31 10:32:31 +02:00
|
|
|
os: windows
|
|
|
|
before_install:
|
|
|
|
- choco upgrade --no-progress -y make netcat curl findutils
|
|
|
|
- export MAKE=mingw32-make
|
2020-09-16 15:16:10 +02:00
|
|
|
after_failure:
|
2020-07-31 10:32:31 +02:00
|
|
|
- |-
|
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
windows)
|
|
|
|
echo "Uploading to termbin.com..."
|
2020-11-04 11:03:33 +01:00
|
|
|
LOG_FILES=$(find ./lntest/itest -name '*.log')
|
|
|
|
for f in $LOG_FILES; do echo -n $f; cat $f | nc termbin.com 9999 | xargs -r0 printf ' uploaded to %s'; done
|
2020-07-31 10:32:31 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-09-16 15:16:10 +02:00
|
|
|
after_failure:
|
2020-07-31 10:32:31 +02:00
|
|
|
- |-
|
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
windows)
|
|
|
|
# Needs other commands, see after_script of the Windows build
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2020-11-04 11:03:33 +01:00
|
|
|
LOG_FILES=$(find ./lntest/itest -name '*.log')
|
|
|
|
echo "Uploading to termbin.com..." && for f in $LOG_FILES; do echo -n $f; cat $f | nc termbin.com 9999 | xargs -r0 printf ' uploaded to %s'; done
|
2020-07-31 10:32:31 +02:00
|
|
|
echo "Uploading to file.io..." && tar -zcvO $LOG_FILES | curl -s -F 'file=@-;filename=logs.tar.gz' https://file.io | xargs -r0 printf 'logs.tar.gz uploaded to %s\n'
|
|
|
|
;;
|
|
|
|
esac
|