Travis CI is pretty cool. It continuously builds/tests apps and is integrated in GitHub and Coveralls, another tool that displays the test coverage. In addition, Travis and Coveralls generate nifty little widgets to display the library’s build status and test coverage.

We’ve recently implemented Travis into our RPC client built on top of Bitcoin-S, a Bitcoin protocol implementation in Scala.

In order to test the RPC client, we had to build Bitcoin inside the Travis build. Integrating Travis is simple, just link your GitHub. Travis is configured in a library’s .travis.yml file. Our configuration boiled down to four essential components: installing bitcoin, creating a .bitcoin directory, copying our bitcoin.conf into it, and starting the bitcoin daemon:

before_install:

- sudo apt-add-repository ppa:bitcoin/bitcoin -y

- sudo apt-get update -qqmoving

- sudo apt-get install bitcoind -y



apt_packages:

- bitcoind



before_script:

- mkdir -p /home/travis/.bitcoin && cp bitcoin.conf /home/travis/.bitcoin/bitcoin.conf

- bitcoind -daemon

With the bitcoin daemon running in regression test mode, we could successfully run tests for our RPC client with Travis.

If you’re interested in how to implement coveralls, link your Travis account, then import (project/plugins.sbt for us):

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")



addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.1.0")

Add to .travis.yml:

script: "sbt clean coverage test"

after_success: "sbt coverageReport coveralls"

I invite you to check out our open-source Bitcoin-S library, and RPC client. Drop us a star for future updates, or follow us on twitter @ThomasMcCabeBTC / @ Chris_Stewart_5.