Configuring Github badges for a Scala project
Hello everyone! This is my first publication and I hope you find it helpful. Today I have developed a quick Scala project with Akka-HTTP a small CRUD API. You can find my code here if you want to check it out https://github.com/pablocanoh/Akka-HTTP
Once your project is done, you just need to configure your repository with Travis CI. All you need to do is adding a config file named .travil.yml like this:
# configuration for build badge
language: scala# configurations for codecov badge
scala:
- 2.12.8script:
- sbt clean coverage test coverageReportafter_success:
- bash <(curl -s https://codecov.io/bash)
After that, you need to create or update a README.md like this:
# Akka-HTTPRepo for testing and playing with Akka[![Build Status](https://travis-ci.com/pablocanoh/Akka-HTTP.svg?branch=master)](https://travis-ci.com/pablocanoh/Akka-HTTP)[![codecov](https://codecov.io/gh/pablocanoh/Akka-HTTP/branch/master/graph/badge.svg)](https://codecov.io/gh/pablocanoh/Akka-HTTP)
Make sure you replace the bold font with your own GitHub username and the name of your repository.
You are going to need to create a file inside project directory with the name plugins.sbt
and add the plugin for the codecov.
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
After that, you just need to follow Travis’s instructions panel and activate the repo.
Once you have everything ready, all is left to do is commit and push your changes to Github. When Travis finishes with the build, you should be able to see your new badges ready in the README.md
In the https://codecov.io panel, a complete description of our test cases and all the code they cover.
And that's everything :)
You can use my code as you wish here is another link to the repository that I used for this quick tutorial https://github.com/pablocanoh/Akka-HTTP
I hope you enjoy this tutorial! :)