bitcoin-s/.travis.yml
2020-03-02 07:55:35 -06:00

101 lines
4.1 KiB
YAML

language: scala
env:
matrix:
- TEST_COMMAND="bitcoindRpcTest/test bitcoindRpc/coverageReport bitcoindRpc/coverageAggregate bitcoindRpc/coveralls eclairRpcTest/test eclairRpc/coverageReport eclairRpc/coverageAggregate eclairRpc/coveralls"
- TEST_COMMAND="appServerTest/test chainTest/test chain/coverageReport chain/coverageAggregate chain/coveralls nodeTest/test node/coverageReport node/coverageAggregate node/coveralls coreTest/test core/coverageReport core/coverageAggregate core/coveralls secp256k1jni/test zmq/test zmq/coverageReport zmq/coverageAggregate zmq/coveralls"
- TEST_COMMAND="keyManagerTest/test keyManager/coverageReport keyManager/coverageAggregate keyManager/coveralls walletTest/test wallet/coverageReport wallet/coverageAggregate wallet/coveralls"
os: linux
scala:
- 2.12.10
- 2.13.1
# Fiddling with Travis config is not fun:-(
# To avoid spending too much time waiting on Travis, you
# can use this tool to parse the config file locally: https://github.com/travis-ci/travis-yml
# After getting it set up, do:
# $ curl -X POST --data-binary @.travis.yml localhost:9292/v1/parse | jq
# this should return a big JSON object, where especially
# config.matrix.include tells you a lot about what the build
# is going to look like
matrix:
include:
# this way of including jobs is not ideal... unfortunately it's not
# possible to nest env.matrix. could a better solution be to write
# a small script that generates a Travis config for us?
- os: linux
name: "Linux compile for 2.11"
env:
- TEST_COMMAND="test:compile"
scala:
- 2.11.12
- os: osx
name: "macOS bitcoind and eclair tests"
env:
- TEST_COMMAND="bitcoindRpcTest/test bitcoindRpc/coverageReport bitcoindRpc/coverageAggregate bitcoindRpc/coveralls eclairRpcTest/test eclairRpc/coverageReport eclairRpc/coverageAggregate eclairRpc/coveralls"
scala:
- 2.13.1
# skip all test tagged as UsesExperimentalBitcoind
# TODO remove this condition once we have a neutrino enabled bitcoind binary for OSX
- os: osx
name: "macOS wallet and node tests"
env:
- TEST_COMMAND="walletTest/test wallet/coverageReport wallet/coverageAggregate wallet/coveralls nodeTest/test node/coverageReport node/coverageAggregate node/coveralls"
scala:
- 2.13.1
# compile website, to check for documentation regressions
- stage: test
name: Compile website and check formatting
script:
- sbt docs/mdoc
- sbt test:scalafmtCheck
# Release snapshots/versions of all libraries
# run ci-release only if previous stages passed
- stage: release
jdk: openjdk8
name: Publish library
script: sbt ci-release
# run website push only if website compilation passed
# we use custom sbt task that first compiles Scaladocs
# and then calls the docusaurusPublishGhpages task
- script: sbt docs/publishWebsite
name: Publish website
# These directories are cached to S3 at the end of the build
# https://www.scala-sbt.org/1.x/docs/Travis-CI-with-sbt.html#Caching
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot/
- $PWD/binaries/bitcoind/
- $PWD/binaries/eclair/
# https://www.scala-sbt.org/1.x/docs/Travis-CI-with-sbt.html#Caching
before_cache:
# Cleanup the cached directories to avoid unnecessary cache updates
- rm -r $PWD/binaries/bitcoind/bitcoin-0.18.99
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete
before_script:
- git fetch --tags
- git submodule sync
stages:
- name: test
if:
commit_message !~ /^Docs:/ AND NOT
((branch = master AND type = push) OR (tag IS present))
# don't run tests on merge builds, just publish library
# and website
- name: release
if: ((branch = master AND type = push) OR (tag IS present)) AND NOT fork
script:
# Modify PATH to include binaries we are about to download
- sbt ++$TRAVIS_SCALA_VERSION downloadBitcoind downloadEclair coverage $TEST_COMMAND